Skip to content

Commit

Permalink
review scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bot-Rakshit committed Jun 27, 2024
1 parent 15cae8d commit adae124
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/config/passport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ import { google } from 'googleapis';

const prisma = new PrismaClient();


interface ProfileJson {
youtubeChannelId?: string;

}


passport.use(
new GoogleStrategy(
{
clientID: process.env.GOOGLE_CLIENT_ID as string,
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
callbackURL: '/api/auth/google/callback',
callbackURL: 'https://shahmaat.fun/api/auth/google/callback',
},
async (accessToken, refreshToken, profile: any, done) => {
const profileJson: ProfileJson = profile._json;
Expand Down Expand Up @@ -103,3 +100,6 @@ passport.use(
}
})
);



6 changes: 5 additions & 1 deletion src/routes/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ router.get(

router.get(
'/google',
passport.authenticate('google', { scope: ['profile', 'email', 'https://www.googleapis.com/auth/youtube.readonly'] })
passport.authenticate('google', {
scope: ['profile', 'email', 'https://www.googleapis.com/auth/youtube.readonly'],
accessType: 'offline',
prompt: 'consent'
})
);

router.get(
Expand Down

0 comments on commit adae124

Please sign in to comment.