mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
load community entity fresh
This commit is contained in:
parent
5876e7db13
commit
51b28edc98
@ -10,6 +10,7 @@ import {
|
||||
FederatedCommunityLoggingView,
|
||||
getHomeCommunity,
|
||||
findPendingCommunityHandshakeOrFailByOneTimeCode,
|
||||
getCommunityByPublicKeyOrFail,
|
||||
} from 'database'
|
||||
import { getLogger } from 'log4js'
|
||||
import {
|
||||
@ -169,11 +170,13 @@ export class AuthenticationResolver {
|
||||
`invalid uuid: ${authArgs.uuid} for community with publicKey ${authComPublicKey.asHex()}`
|
||||
)
|
||||
}
|
||||
authCom.publicKey = authComPublicKey.asBuffer()
|
||||
authCom.communityUuid = communityUuid.data
|
||||
authCom.authenticatedAt = new Date()
|
||||
const authComFresh = await getCommunityByPublicKeyOrFail(authComPublicKey)
|
||||
authComFresh.communityUuid = communityUuid.data
|
||||
authComFresh.authenticatedAt = new Date()
|
||||
methodLogger.debug('try to save: ', authCom)
|
||||
await authCom.save()
|
||||
await authComFresh.save().catch((err) => {
|
||||
methodLogger.fatal('failed to save authCom:', err)
|
||||
})
|
||||
methodLogger.debug('store authCom.uuid successfully:', new CommunityLoggingView(authCom))
|
||||
const homeComB = await getHomeCommunity()
|
||||
if (homeComB?.communityUuid) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user