next-auth
Version:
Authentication for Next.js
36 lines (32 loc) • 727 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Cognito;
function Cognito(options) {
const {
domain
} = options;
return {
id: "cognito",
name: "Cognito",
type: "oauth",
version: "2.0",
scope: "openid profile email",
params: {
grant_type: "authorization_code"
},
accessTokenUrl: `https://${domain}/oauth2/token`,
authorizationUrl: `https://${domain}/oauth2/authorize?response_type=code`,
profileUrl: `https://${domain}/oauth2/userInfo`,
profile(profile) {
return {
id: profile.sub,
name: profile.username,
email: profile.email,
image: null
};
},
...options
};
}