fix: Enable offline access to google accounts (#2392)

* Enable google offline access

* Prevent overriding prompt parameter
This commit is contained in:
Saumya Pandey
2021-07-30 08:34:57 +05:30
committed by GitHub
parent 928106067f
commit 37fd7ec97a

View File

@@ -36,7 +36,6 @@ if (GOOGLE_CLIENT_ID) {
clientID: GOOGLE_CLIENT_ID,
clientSecret: GOOGLE_CLIENT_SECRET,
callbackURL: `${env.URL}/auth/google.callback`,
prompt: "select_account consent",
passReqToCallback: true,
store: new StateStore(),
scope: scopes,
@@ -87,7 +86,13 @@ if (GOOGLE_CLIENT_ID) {
)
);
router.get("google", passport.authenticate(providerName));
router.get(
"google",
passport.authenticate(providerName, {
accessType: "offline",
prompt: "select_account consent",
})
);
router.get("google.callback", passportMiddleware(providerName));
}