diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index 2a66fbeb3..25be024a6 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -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 }