mirror of
https://github.com/strapi/strapi.git
synced 2025-12-17 02:03:18 +00:00
Allow configuration of SSO Cookie Domain
This commit is contained in:
parent
6000668673
commit
156a6d9ece
@ -95,13 +95,14 @@ const redirectWithAuth = (ctx) => {
|
|||||||
params: { provider },
|
params: { provider },
|
||||||
} = ctx;
|
} = ctx;
|
||||||
const redirectUrls = utils.getPrefixedRedirectUrls();
|
const redirectUrls = utils.getPrefixedRedirectUrls();
|
||||||
|
const domain = strapi.config.get('server.admin.auth.domain');
|
||||||
const { user } = ctx.state;
|
const { user } = ctx.state;
|
||||||
|
|
||||||
const jwt = getService('token').createJwtToken(user);
|
const jwt = getService('token').createJwtToken(user);
|
||||||
|
|
||||||
const isProduction = strapi.config.get('environment') === 'production';
|
const isProduction = strapi.config.get('environment') === 'production';
|
||||||
|
|
||||||
const cookiesOptions = { httpOnly: false, secure: isProduction, overwrite: true };
|
const cookiesOptions = { httpOnly: false, secure: isProduction, overwrite: true, domain };
|
||||||
|
|
||||||
const sanitizedUser = getService('user').sanitizeUser(user);
|
const sanitizedUser = getService('user').sanitizeUser(user);
|
||||||
strapi.eventHub.emit('admin.auth.success', { user: sanitizedUser, provider });
|
strapi.eventHub.emit('admin.auth.success', { user: sanitizedUser, provider });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user