Skip to content

Commit

Permalink
Fix: client cookie domain (#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
avine authored Jul 3, 2024
1 parent 569cdf5 commit 6731528
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/src/app/shared/i18n/language/language.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { APP_BASE_HREF, DOCUMENT } from '@angular/common';
import { Injectable, LOCALE_ID, inject } from '@angular/core';
import Cookies from 'js-cookie';
import { environment } from '../../../../environments/environment';
import { LOCALE_ID_COOKIE_KEY } from './language.config';
import { AppBaseHref, LocaleId } from './language.types';

Expand Down Expand Up @@ -34,7 +35,7 @@ export class LanguageService {
}

private setCookie(localeId: LocaleId) {
Cookies.set(LOCALE_ID_COOKIE_KEY, localeId, { expires: 365 });
Cookies.set(LOCALE_ID_COOKIE_KEY, localeId, { expires: 365, domain: environment.appDomain });
}

private switchApp(newAppBaseHref: AppBaseHref) {
Expand Down
1 change: 1 addition & 0 deletions client/src/environments/environment.dev-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const firebaseOptions: FirebaseOptions = {
export const environment = {
production: false,
appVersion: APP_VERSION,
appDomain: 'localhost',
firebaseOptions,
apiBaseUrl: 'http://localhost:3000', // `dev-local` and `dev-remote` environments differ only here
allowedEmailDomains: ['zenika.com', 'zenika.ch'],
Expand Down
1 change: 1 addition & 0 deletions client/src/environments/environment.dev-remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const firebaseOptions: FirebaseOptions = {
export const environment = {
production: false,
appVersion: APP_VERSION,
appDomain: '.znk.io',
firebaseOptions,
apiBaseUrl: 'https://server.dev.feedzback.znk.io', // `dev-local` and `dev-remote` environments differ only here
allowedEmailDomains: ['zenika.com', 'zenika.ch'],
Expand Down
1 change: 1 addition & 0 deletions client/src/environments/environment.staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const firebaseOptions: FirebaseOptions = {
export const environment = {
production: false,
appVersion: APP_VERSION,
appDomain: '.znk.io',
firebaseOptions,
apiBaseUrl: 'https://server.staging.feedzback.znk.io',
allowedEmailDomains: ['zenika.com', 'zenika.ch'],
Expand Down
1 change: 1 addition & 0 deletions client/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const firebaseOptions: FirebaseOptions = {
export const environment = {
production: true,
appVersion: APP_VERSION,
appDomain: '.znk.io',
firebaseOptions,
apiBaseUrl: 'https://server.feedzback.znk.io',
allowedEmailDomains: ['zenika.com', 'zenika.ch'],
Expand Down

0 comments on commit 6731528

Please sign in to comment.