Skip to content

Commit

Permalink
fix: github and google oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
maalni committed Apr 1, 2024
1 parent 902e031 commit 5363c76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/auth/githubOAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { config } from '../utils/envManager';
const setupGitHubOAuth = (app: Express): void => {
app.get('/auth/github', passport.authenticate('github'));
app.get(
config.BACKEND_URL + '/auth/github/callback',
'/auth/github/callback',
passport.authenticate('github', { failureRedirect: '/login' }),
(req, res) => {
res.redirect('/');
Expand All @@ -18,7 +18,7 @@ const setupGitHubOAuth = (app: Express): void => {
{
clientID: config.GITHUB_CLIENT_ID,
clientSecret: config.GITHUB_CLIENT_SECRET,
callbackURL: '/auth/github/callback'
callbackURL: config.BACKEND_URL + '/auth/github/callback'
},
async (accessToken, refreshToken, profile, cb) => {
const email = profile.emails?.[0].value ?? '';
Expand Down
4 changes: 2 additions & 2 deletions src/auth/googleOAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { config } from '../utils/envManager';
const setupGoogleOAuth = (app: Express): void => {
app.get('/auth/google', passport.authenticate('google'));
app.get(
config.BACKEND_URL + '/auth/google/callback',
'/auth/google/callback',
passport.authenticate('google', { failureRedirect: '/login' }),
(req, res) => {
res.redirect('/');
Expand All @@ -18,7 +18,7 @@ const setupGoogleOAuth = (app: Express): void => {
{
clientID: config.GOOGLE_CLIENT_ID,
clientSecret: config.GOOGLE_CLIENT_SECRET,
callbackURL: '/auth/google/callback',
callbackURL: config.BACKEND_URL + '/auth/google/callback',
scope: ['profile', 'email']
},
async (accessToken, refreshToken, profile, cb) => {
Expand Down

0 comments on commit 5363c76

Please sign in to comment.