Skip to content

Commit

Permalink
fix: remove api-token cookie from root '/' path (#1487)
Browse files Browse the repository at this point in the history
* added 'options' to cookies remove method to be able to provide 'path'
  • Loading branch information
Eisie96 committed Aug 22, 2023
1 parent 2476312 commit 9ce4cf6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/core/utils/api-token/api-token.service.ts
Expand Up @@ -96,7 +96,7 @@ export class ApiTokenService {
path: '/',
});
} else {
cookiesService.remove('apiToken');
cookiesService.remove('apiToken', { path: '/' });
}
});

Expand Down
4 changes: 2 additions & 2 deletions src/app/core/utils/cookies/cookies.service.ts
Expand Up @@ -34,9 +34,9 @@ export class CookiesService {
return !SSR ? (this.cookiesReader()[key] as string) : undefined;
}

remove(key: string) {
remove(key: string, options?: CookiesOptions) {
if (!SSR) {
this.cookiesWriter()(key, undefined);
this.cookiesWriter()(key, undefined, options);
}
}

Expand Down

0 comments on commit 9ce4cf6

Please sign in to comment.