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
2 changes: 1 addition & 1 deletion src/callback-endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const createCallbackEndpoint = (
let access_token: string;

if (pluginOptions.getToken) {
access_token = pluginOptions.getToken(code);
access_token = await pluginOptions.getToken(code);
} else {
const tokenResponse = await fetch(pluginOptions.tokenEndpoint, {
method: "POST",
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export interface PluginTypes {
* Function to get token from the OAuth providers.
* If its not provided default will be used.
*/
getToken?: (code: string) => string;
getToken?: (code: string) => string | Promise<string>;

/**
* Redirect users after successful login.
Expand Down
Loading