Skip to content

Commit

Permalink
Refactor signature of validateAccessToken
Browse files Browse the repository at this point in the history
  • Loading branch information
nkshah2 committed Sep 7, 2023
1 parent b8f2841 commit 650db61
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/build/recipe/thirdparty/providers/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ function NewProvider(input) {
*/
if (impl.config.validateAccessToken !== undefined) {
yield impl.config.validateAccessToken({
accessTokenPayload: rawUserInfoFromProvider.fromUserInfoAPI,
accessToken: accessToken,
clientConfig: impl.config,
userContext,
});
Expand Down
4 changes: 1 addition & 3 deletions lib/build/recipe/thirdparty/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ declare type CommonProviderConfig = {
* @param input.userContext Refer to https://supertokens.com/docs/thirdparty/advanced-customizations/user-context
*/
validateAccessToken?: (input: {
accessTokenPayload: {
[key: string]: any;
};
accessToken: string;
clientConfig: ProviderConfigForClientType;
userContext: any;
}) => Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion lib/ts/recipe/thirdparty/providers/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export default function NewProvider(input: ProviderInput): TypeProvider {
*/
if (impl.config.validateAccessToken !== undefined) {
await impl.config.validateAccessToken({
accessTokenPayload: rawUserInfoFromProvider.fromUserInfoAPI,
accessToken: accessToken,
clientConfig: impl.config,
userContext,
});
Expand Down
2 changes: 1 addition & 1 deletion lib/ts/recipe/thirdparty/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type CommonProviderConfig = {
* @param input.userContext Refer to https://supertokens.com/docs/thirdparty/advanced-customizations/user-context
*/
validateAccessToken?: (input: {
accessTokenPayload: { [key: string]: any };
accessToken: string;
clientConfig: ProviderConfigForClientType;
userContext: any;
}) => Promise<void>;
Expand Down

0 comments on commit 650db61

Please sign in to comment.