Skip to content

Commit

Permalink
Fix Error: JSON.parse: unexpected character at line 1 column 1 of the…
Browse files Browse the repository at this point in the history
… JSON data
  • Loading branch information
poulch committed Jan 3, 2025
1 parent daf750a commit a68d49f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/auth/hooks/useAuthProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,19 @@ export function useAuthProvider({ intl, notify, apolloClient }: UseAuthProviderO
}
};
const handleRequestExternalLogin = async (pluginId: string, input: RequestExternalLoginInput) => {
let stringifyInput: string;

try {
stringifyInput = JSON.stringify(input);
} catch (error) {
setErrors(["externalLoginError"]);

return;
}

const result = await getExternalAuthUrl({
pluginId,
input: JSON.stringify(input),
input: stringifyInput,
});

return result?.data?.externalAuthenticationUrl;
Expand Down

0 comments on commit a68d49f

Please sign in to comment.