Skip to content

Commit

Permalink
fix: remove apiToken cookie if a request fails due to an invalid token (
Browse files Browse the repository at this point in the history
#1452)

In the case of local development, you can change the target back-end by modifying the value of the
variable icmBaseURL' variable in environment.developement.ts. By doing so, you will need a new api
token. However, as your local DNS is still \"localhost\", there is no token renewal and the old token
is kept. This small modification corrects this problem.

---------

Co-authored-by: Silke <s.grueber@intershop.de>
  • Loading branch information
tbouliere-datasolution and SGrueber authored Jun 29, 2023
1 parent d8f722d commit 57d0fa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/core/utils/api-token/api-token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export class ApiTokenService {

private isAuthTokenError(err: unknown) {
return (
err instanceof HttpErrorResponse && typeof err.error === 'string' && err.error.includes('AuthenticationToken')
err instanceof HttpErrorResponse && typeof err.error === 'string' && err.error?.toLowerCase().includes('token')
);
}

Expand Down

0 comments on commit 57d0fa8

Please sign in to comment.