Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fileignoreconfig:
- filename: packages/contentstack-export-to-csv/src/types/index.ts
checksum: 28c19efb0c13969d40df964f86fa6de444316e320801f19dee7392df7a36851d
- filename: package-lock.json
checksum: 62632519fd82d3941a5e7434fd86a3daf122d7922d765b27147c43ef08f01d87
checksum: 8622177c9f0bd80a3cedcb2e562ee0a9bb24436fea4c96724277b42d8c813496
- filename: pnpm-lock.yaml
checksum: 7615fbce5f716d889b6558fb06df28d1f34c9e2af7225eb22ed23e2817d6dd69
checksum: ace2f01074f779a648ca15f76cde1b88489e2f7f741fb469772ad706209c0fe9
version: '1.0'
154 changes: 77 additions & 77 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-auth",
"description": "Contentstack CLI plugin for authentication activities",
"version": "1.7.2",
"version": "1.7.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand Down
30 changes: 0 additions & 30 deletions packages/contentstack-auth/src/utils/auth-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,36 +182,6 @@ class AuthHandler {
}
});
}

/**
* Validate token
* @param {string} authtoken
* @returns {Promise} Promise object returns response object from Contentstack
*/
async validateAuthtoken(authtoken: string): Promise<object> {
log.debug('Starting token validation.', { module: 'auth-handler', hasAuthToken: !!authtoken });

return new Promise((resolve, reject) => {
if (authtoken) {
log.debug('Making token validation API call.', { module: 'auth-handler' });

this._client
.getUser()
.then((user: object) => {
log.debug('Token validation successful.', { module: 'auth-handler', user });
resolve(user);
})
.catch((error: Error) => {
log.debug('Token validation failed.', { module: 'auth-handler', error: error.message });
cliux.print('CLI_AUTH_TOKEN_VALIDATION_FAILED', { color: 'yellow' });
reject(error);
});
} else {
log.debug('Token validation failed: no auth token provided.', { module: 'auth-handler' });
reject(new Error(messageHandler.parse('CLI_AUTH_TOKEN_VALIDATION_NO_TOKEN')));
}
});
}
}

export default new AuthHandler();
1 change: 0 additions & 1 deletion packages/contentstack-auth/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { default as authHandler } from './auth-handler';
export { default as mfaHandler } from './mfa-handler';
export * as interactive from './interactive';
export * as tokenValidation from './tokens-validation';
Loading
Loading