UNPKG

@hapi/bell

Version:

Third-party login plugin for hapi

22 lines (15 loc) 470 B
'use strict'; const internals = {}; exports = module.exports = function (options) { const uri = options?.uri ?? 'https://gitlab.com'; const user = `${uri}/api/v3/user`; return { protocol: 'oauth2', auth: `${uri}/oauth/authorize`, token: `${uri}/oauth/token`, profile: async function (credentials, params, get) { const profile = await get(user); credentials.profile = profile; } }; };