Skip to content

Commit

Permalink
fix: added oauth callback url
Browse files Browse the repository at this point in the history
  • Loading branch information
berenteb committed Jan 21, 2024
1 parent f903272 commit 2c24eb3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/backend/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ JWT_EXPIRATION=2h
ADMIN_SITE_CALLBACK=http://localhost:3001/login
MONGODB_URI=mongodb://localhost:27017/indulasch
FUTAR_API_KEY=
OAUTH_REDIRECT_URI=http://localhost:3002/auth/callback
OAUTH_CLIENT_ID=
OAUTH_CLIENT_SECRET=
OAUTH_BASE_URL=
Expand Down
1 change: 1 addition & 0 deletions packages/backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SECRET=
JWT_EXPIRATION=
ADMIN_SITE_CALLBACK=
MONGODB_URI=
OATUH_REDIRECT_URI=
OAUTH_CLIENT_ID=
OAUTH_CLIENT_SECRET=
OAUTH_BASE_URL=
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/strategies/auth0.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class Auth0Strategy extends PassportStrategy(Strategy, 'auth0') {
clientSecret: configService.get(ConfigKeys.OAUTH_CLIENT_SECRET),
profileURL: `${configService.get(ConfigKeys.OAUTH_BASE_URL)}/userinfo`,
scope: ['profile', 'openid', 'email'],
callbackURL: `http://localhost:3002/admin/auth/callback`,
callbackURL: configService.get(ConfigKeys.OAUTH_REDIRECT_URI),
});
}

Expand Down
2 changes: 2 additions & 0 deletions packages/backend/src/utils/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ export default () => ({
mailServerUrl: process.env.MAIL_SERVER_URL,
mailApiKey: process.env.MAIL_API_KEY,
template_root: process.env.TEMPLATE_ROOT,
oauth_redirect_uri: process.env.OAUTH_REDIRECT_URI,
});

export enum ConfigKeys {
ADMIN_SITE_CALLBACK = 'admin_site_callback',
OAUTH_REDIRECT_URI = 'oauth_redirect_uri',
OAUTH_BASE_URL = 'oauth_base_url',
OAUTH_CLIENT_ID = 'oauth_client_id',
OAUTH_CLIENT_SECRET = 'oauth_client_secret',
Expand Down

2 comments on commit 2c24eb3

@vercel
Copy link

@vercel vercel bot commented on 2c24eb3 Jan 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 2c24eb3 Jan 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.