change client request time to client time zone offset

This commit is contained in:
Moriz Wahl 2022-11-15 13:00:59 +01:00
parent 6ae1ba79f7
commit cff2396bd1
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ const authLink = new ApolloLink((operation, forward) => {
operation.setContext({
headers: {
Authorization: token && token.length > 0 ? `Bearer ${token}` : '',
clientRequestTime: new Date().toString(),
clientTimezoneOffset: new Date().getTimezoneOffset(),
},
})
return forward(operation).map((response) => {

View File

@ -98,7 +98,7 @@ describe('apolloProvider', () => {
expect(setContextMock).toBeCalledWith({
headers: {
Authorization: 'Bearer some-token',
clientRequestTime: expect.any(String),
clientTimezoneOffset: expect.any(Number),
},
})
})
@ -114,7 +114,7 @@ describe('apolloProvider', () => {
expect(setContextMock).toBeCalledWith({
headers: {
Authorization: '',
clientRequestTime: expect.any(String),
clientTimezoneOffset: expect.any(Number),
},
})
})