Allow configuration of SSO Cookie Domain (#16471)

This commit is contained in:
DMehaffy 2023-04-24 03:33:20 -07:00 committed by GitHub
parent 7bdbd665af
commit 7f1bb7e73f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,13 +95,14 @@ const redirectWithAuth = (ctx) => {
params: { provider },
} = ctx;
const redirectUrls = utils.getPrefixedRedirectUrls();
const domain = strapi.config.get('server.admin.auth.domain');
const { user } = ctx.state;
const jwt = getService('token').createJwtToken(user);
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);
strapi.eventHub.emit('admin.auth.success', { user: sanitizedUser, provider });