Skip to content

Commit

Permalink
fix(auth): guest guard always triggers logout for a guest user (#2524)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 committed Jul 31, 2023
1 parent 17013f1 commit 6025568
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
3 changes: 0 additions & 3 deletions libs/auth/driver/src/constants/unauthenticated-error-codes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { DaffAuthErrorCodes } from '@daffodil/auth';

import { DaffAuthDriverErrorCodes } from '../errors/public_api';

/**
Expand All @@ -11,5 +9,4 @@ import { DaffAuthDriverErrorCodes } from '../errors/public_api';
export const DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES = {
[DaffAuthDriverErrorCodes.UNAUTHORIZED]: true,
[DaffAuthDriverErrorCodes.AUTHENTICATION_FAILED]: true,
[DaffAuthErrorCodes.MISSING_TOKEN]: true,
};
14 changes: 0 additions & 14 deletions libs/auth/state/src/effects/auth.effects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,6 @@ describe('@daffodil/auth/state | DaffAuthEffects', () => {
});
});

describe('when DaffAuthCheckFailure is dispatched for an missing token error', () => {
let revokeAction: DaffAuthCheckFailure;

beforeEach(() => {
revokeAction = new DaffAuthCheckFailure(new DaffAuthMissingTokenError('error'));
actions$ = hot('--a', { a: revokeAction });
expected = cold('--a', { a: new DaffAuthResetToUnauthenticated(revokeAction.type) });
});

it('should dispatch DaffAuthResetToUnauthenticated', () => {
expect(effects.resetToUnauthenticated$).toBeObservable(expected);
});
});

describe('when DaffAuthCheckFailure is dispatched for some random reason', () => {
let revokeAction: DaffAuthCheckFailure;

Expand Down

0 comments on commit 6025568

Please sign in to comment.