|
|
|
@ -11,12 +11,19 @@ export class CookiesService {
|
|
|
|
|
private readonly USERNAME_KEY = 'username';
|
|
|
|
|
private readonly USER_ID = 'userId';
|
|
|
|
|
private readonly IS_ADMIN_KEY = 'isAdmin';
|
|
|
|
|
private readonly COOKIE_OPTIONS = {
|
|
|
|
|
|
|
|
|
|
private get COOKIE_OPTIONS() {
|
|
|
|
|
const isLocalhost = window.location.hostname === 'localhost' ||
|
|
|
|
|
window.location.hostname === '127.0.0.1' ||
|
|
|
|
|
window.location.hostname.includes('localhost');
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
path: '/',
|
|
|
|
|
domain: window.location.hostname,
|
|
|
|
|
secure: true,
|
|
|
|
|
secure: !isLocalhost,
|
|
|
|
|
sameSite: 'Strict' as const,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
private router: Router,
|
|
|
|
|