diff --git a/packages/authentication-oauth/src/index.ts b/packages/authentication-oauth/src/index.ts index 4bad654100..3d45fdeba4 100644 --- a/packages/authentication-oauth/src/index.ts +++ b/packages/authentication-oauth/src/index.ts @@ -41,14 +41,14 @@ export const setup = (options: OauthSetupSettings) => (app: Application) => { } } - const grant = defaultsDeep({}, omit(oauth, ['redirect', 'origins']), { + const grant = defaultsDeep({ defaults: { prefix, - origin: `${protocol}://${host}`, - transport: 'session', + origin: `${oauth?.defaults?.protocol ?? protocol}://${oauth?.defaults?.host ?? host}`, + transport: oauth?.defaults?.transport ?? 'session', response: ['tokens', 'raw', 'profile'] } - }); + }, omit(oauth, ['redirect', 'origins'])); const getUrl = (url: string) => { const { defaults } = grant;