mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-17 08:31:47 +03:00
Workaround for bug on token conflict with front and storybook (#1843)
* workound to preview token * remote token itself
This commit is contained in:
parent
42e8869e0e
commit
27eab82f19
@ -7,7 +7,7 @@ import { YogaDriver, YogaDriverConfig } from '@graphql-yoga/nestjs';
|
||||
import GraphQLJSON from 'graphql-type-json';
|
||||
import { GraphQLError, GraphQLSchema } from 'graphql';
|
||||
import { ExtractJwt } from 'passport-jwt';
|
||||
import { TokenExpiredError, verify } from 'jsonwebtoken';
|
||||
import { TokenExpiredError, JsonWebTokenError, verify } from 'jsonwebtoken';
|
||||
|
||||
import { AppService } from './app.service';
|
||||
|
||||
@ -77,6 +77,14 @@ import {
|
||||
|
||||
return conditionalSchema;
|
||||
} catch (error) {
|
||||
if (error instanceof JsonWebTokenError) {
|
||||
//mockedUserJWT
|
||||
throw new GraphQLError('Unauthenticated', {
|
||||
extensions: {
|
||||
code: 'UNAUTHENTICATED',
|
||||
},
|
||||
});
|
||||
}
|
||||
if (error instanceof TokenExpiredError) {
|
||||
throw new GraphQLError('Unauthenticated', {
|
||||
extensions: {
|
||||
|
Loading…
Reference in New Issue
Block a user