Skip to content

Commit

Permalink
Merge pull request #432 from sivertschou/remove-extra-approval-prompt
Browse files Browse the repository at this point in the history
Remove extra approval prompt
  • Loading branch information
sivertschou authored Nov 12, 2024
2 parents 5c78719 + ce24136 commit eb41f3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/frontend/src/components/ConnectWithStravaButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { chakra, ImageProps, forwardRef, Link } from '@chakra-ui/react';
import logo from '../assets/connect-with-strava.svg';
import { getEnv } from '../utils/environment';

export const getStravaAuthorizeUrl = (params = { forcePrompt: false }) => {
export const getStravaAuthorizeUrl = (params: { forcePrompt: boolean }) => {
const clientId = getEnv().stravaClientId;
return `https://www.strava.com/oauth/authorize?client_id=${clientId}&redirect_uri=${location.origin}/auth/strava&response_type=code&approval_prompt=auto&scope=read,activity:write&approval_prompt=${params.forcePrompt ? 'force' : 'auto'}`;
return `https://www.strava.com/oauth/authorize?client_id=${clientId}&redirect_uri=${location.origin}/auth/strava&response_type=code&scope=read,activity:write&approval_prompt=${params.forcePrompt ? 'force' : 'auto'}`;
};

export const ConnectWithStravaButton = () => {
return (
<Link href={getStravaAuthorizeUrl()}>
<Link href={getStravaAuthorizeUrl({ forcePrompt: false })}>
<ConnectWithStravaGraphics />
</Link>
);
Expand Down

0 comments on commit eb41f3d

Please sign in to comment.