mirror of
https://github.com/graphql-hive/console
synced 2026-05-23 09:08:34 +00:00
Cut short all tokens that are not 32 chars long in TokenStorage (#600)
This commit is contained in:
parent
d5c9a8fad5
commit
849da7bc53
1 changed files with 5 additions and 0 deletions
|
|
@ -127,6 +127,11 @@ export class TokenStorage {
|
|||
|
||||
@atomic<TokenSelector>(({ token }) => token)
|
||||
async getToken({ token }: TokenSelector) {
|
||||
// Tokens are MD5 hashes, so they are always 32 characters long
|
||||
if (token.length !== 32) {
|
||||
throw new HiveError('Invalid token provided!');
|
||||
}
|
||||
|
||||
this.logger.debug('Fetching token (token=%s)', maskToken(token));
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in a new issue