Skip to content

Commit

Permalink
fix scope encoding in login url (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
justincorrigible authored Nov 17, 2021
1 parent 538e194 commit de589fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/LoginButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ const LoginButton = ({ Icon, title }: { Icon?: React.ComponentType<IconProps>; t
url.searchParams.append('redirect_uri', NEXT_PUBLIC_AUTH_REDIRECT_URI);
url.searchParams.append('response_type', 'code');
url.searchParams.append('resource', window.origin);
url.searchParams.append('scope', NEXT_PUBLIC_AUTH_SCOPES);
url.searchParams.append('scope', encodeURI(NEXT_PUBLIC_AUTH_SCOPES));

return (
<a
href={url.href}
// to respect '+' signs, as they break when using the `searchParams` API
href={url.href.replaceAll('%2B', '+')}
css={css`
text-decoration: none;
`}
Expand Down

0 comments on commit de589fe

Please sign in to comment.