catch errors with klicktipp - do not fail setPassword on failing klicktipp

This commit is contained in:
Ulf Gebhardt 2021-11-24 04:15:50 +01:00
parent 4bdcff8152
commit d07bd472b0
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -505,12 +505,6 @@ export class UserResolver {
loginUser.privKey = encryptedPrivkey
dbUser.pubkey = keyPair[0]
// Sign into Klicktipp
// TODO do we always signUp the user? How to handle things with old users?
if (optInCode.emailOptInTypeId === EMAIL_OPT_IN_REGISTER) {
await signIn(loginUser.email, loginUser.language, loginUser.firstName, loginUser.lastName)
}
const queryRunner = getConnection().createQueryRunner()
await queryRunner.connect()
await queryRunner.startTransaction('READ UNCOMMITTED')
@ -539,6 +533,17 @@ export class UserResolver {
await queryRunner.release()
}
// Sign into Klicktipp
// TODO do we always signUp the user? How to handle things with old users?
if (optInCode.emailOptInTypeId === EMAIL_OPT_IN_REGISTER) {
try {
await signIn(loginUser.email, loginUser.language, loginUser.firstName, loginUser.lastName)
} catch {
// TODO is this a problem?
console.log('Could not subscribe to klicktipp')
}
}
return true
}