Skip to content

Instantly share code, notes, and snippets.

@sameeraakbar
Created March 9, 2023 09:06
Show Gist options
  • Save sameeraakbar/a8bd59911895c47030c23a91798d9086 to your computer and use it in GitHub Desktop.
Save sameeraakbar/a8bd59911895c47030c23a91798d9086 to your computer and use it in GitHub Desktop.
adminAuth: {
type: "strategy",
strategy: {
name: "google",
label: 'Sign in with Google',
icon: "fa-google",
strategy: require('passport-google-oauth').OAuth2Strategy,
options: {
clientID: 'id',
clientSecret: 'secret',
scope: 'email',
callbackURL: "http://127.0.0.1:1880/auth/strategy/callback",
verify: function (token, tokenSecret, profile, done) {
profile.username = profile.emails.find(x => x.verified).value;
done(null, profile);
}
}
},
users: function (username) {
return Promise.resolve({
username: username,
permissions: "*"
});
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment