mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
fix const 10 minutes not 10 hours (._.);, update logging
This commit is contained in:
parent
40c0c2f143
commit
5dd337e96c
@ -59,7 +59,7 @@ export async function startCommunityAuthentication(
|
||||
if (existingState) {
|
||||
const stateLogic = new CommunityHandshakeStateLogic(existingState)
|
||||
// retry on timeout or failure
|
||||
if (!await stateLogic.isTimeoutUpdate()) {
|
||||
if (!(await stateLogic.isTimeoutUpdate())) {
|
||||
// authentication with community and api version is still in progress and it is not timeout yet
|
||||
methodLogger.debug('existingState, so we exit here', new CommunityHandshakeStateLoggingView(existingState))
|
||||
return
|
||||
|
||||
22
core/src/logic/CommunityHandshakeStateLogic.test.ts
Normal file
22
core/src/logic/CommunityHandshakeStateLogic.test.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { CommunityHandshakeState } from 'database'
|
||||
import { CommunityHandshakeStateLogic } from './CommunityHandshakeState.logic'
|
||||
import { CommunityHandshakeStateType } from 'database'
|
||||
import { FEDERATION_AUTHENTICATION_TIMEOUT_MS } from 'shared'
|
||||
|
||||
describe('CommunityHandshakeStateLogic', () => {
|
||||
it('isTimeout', () => {
|
||||
const state = new CommunityHandshakeState()
|
||||
state.updatedAt = new Date(Date.now() - FEDERATION_AUTHENTICATION_TIMEOUT_MS * 2)
|
||||
state.status = CommunityHandshakeStateType.START_AUTHENTICATION
|
||||
const logic = new CommunityHandshakeStateLogic(state)
|
||||
expect(logic.isTimeout()).toEqual(true)
|
||||
})
|
||||
|
||||
it('isTimeout return false', () => {
|
||||
const state = new CommunityHandshakeState()
|
||||
state.updatedAt = new Date(Date.now())
|
||||
state.status = CommunityHandshakeStateType.START_AUTHENTICATION
|
||||
const logic = new CommunityHandshakeStateLogic(state)
|
||||
expect(logic.isTimeout()).toEqual(false)
|
||||
})
|
||||
})
|
||||
@ -3,4 +3,4 @@ export const SECONDS_PER_YEAR_GREGORIAN_CALENDER = 31556952.0
|
||||
export const LOG4JS_BASE_CATEGORY_NAME = 'shared'
|
||||
export const REDEEM_JWT_TOKEN_EXPIRATION = '10m'
|
||||
// 10 minutes
|
||||
export const FEDERATION_AUTHENTICATION_TIMEOUT_MS = 60 * 60 * 1000 * 10
|
||||
export const FEDERATION_AUTHENTICATION_TIMEOUT_MS = 60 * 1000 * 10
|
||||
Loading…
x
Reference in New Issue
Block a user