Skip to content

Commit e13d6d4

Browse files
author
Ihar
committed
fix: cache user by id when user is not exist
1 parent 4f9117f commit e13d6d4

File tree

1 file changed

+1
-1
lines changed
  • api-gateway/src/helpers/interceptors/utils

1 file changed

+1
-1
lines changed

api-gateway/src/helpers/interceptors/utils/hash.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import crypto from 'crypto';
44
import {IAuthUser} from '@guardian/common';
55

66
export function getHash(user: IAuthUser | null): string {
7-
return crypto.createHash('md5').update(JSON.stringify(user.id ?? 'anonymous')).digest('hex');
7+
return crypto.createHash('md5').update(JSON.stringify(user?.id ?? 'anonymous')).digest('hex');
88
}

0 commit comments

Comments
 (0)