mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 2119-New-menu-item-GDT
This commit is contained in:
commit
ccaf01dc37
@ -25,6 +25,14 @@
|
|||||||
"keepFileExt" : true,
|
"keepFileExt" : true,
|
||||||
"fileNameSep" : "_"
|
"fileNameSep" : "_"
|
||||||
},
|
},
|
||||||
|
"klicktipp":
|
||||||
|
{
|
||||||
|
"type": "dateFile",
|
||||||
|
"filename": "../logs/backend/klicktipp.log",
|
||||||
|
"pattern": "%d{ISO8601} %p %c %X{user} %f:%l %m",
|
||||||
|
"keepFileExt" : true,
|
||||||
|
"fileNameSep" : "_"
|
||||||
|
},
|
||||||
"errorFile":
|
"errorFile":
|
||||||
{
|
{
|
||||||
"type": "dateFile",
|
"type": "dateFile",
|
||||||
@ -90,6 +98,17 @@
|
|||||||
"level": "debug",
|
"level": "debug",
|
||||||
"enableCallStack": true
|
"enableCallStack": true
|
||||||
},
|
},
|
||||||
|
"klicktipp":
|
||||||
|
{
|
||||||
|
"appenders":
|
||||||
|
[
|
||||||
|
"klicktipp",
|
||||||
|
"out",
|
||||||
|
"errors"
|
||||||
|
],
|
||||||
|
"level": "debug",
|
||||||
|
"enableCallStack": true
|
||||||
|
},
|
||||||
"http":
|
"http":
|
||||||
{
|
{
|
||||||
"appenders":
|
"appenders":
|
||||||
|
|||||||
@ -501,7 +501,7 @@ export class AdminResolver {
|
|||||||
order: { updatedAt: 'DESC' },
|
order: { updatedAt: 'DESC' },
|
||||||
})
|
})
|
||||||
|
|
||||||
optInCode = await checkOptInCode(optInCode, user.id)
|
optInCode = await checkOptInCode(optInCode, user)
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const emailSent = await sendAccountActivationEmail({
|
const emailSent = await sendAccountActivationEmail({
|
||||||
|
|||||||
@ -187,7 +187,7 @@ const newEmailOptIn = (userId: number): LoginEmailOptIn => {
|
|||||||
// if optIn does not exits, it is created
|
// if optIn does not exits, it is created
|
||||||
export const checkOptInCode = async (
|
export const checkOptInCode = async (
|
||||||
optInCode: LoginEmailOptIn | undefined,
|
optInCode: LoginEmailOptIn | undefined,
|
||||||
userId: number,
|
user: DbUser,
|
||||||
optInType: OptInType = OptInType.EMAIL_OPT_IN_REGISTER,
|
optInType: OptInType = OptInType.EMAIL_OPT_IN_REGISTER,
|
||||||
): Promise<LoginEmailOptIn> => {
|
): Promise<LoginEmailOptIn> => {
|
||||||
logger.info(`checkOptInCode... ${optInCode}`)
|
logger.info(`checkOptInCode... ${optInCode}`)
|
||||||
@ -207,15 +207,18 @@ export const checkOptInCode = async (
|
|||||||
optInCode.updatedAt = new Date()
|
optInCode.updatedAt = new Date()
|
||||||
optInCode.resendCount++
|
optInCode.resendCount++
|
||||||
} else {
|
} else {
|
||||||
logger.trace('create new OptIn for userId=' + userId)
|
logger.trace('create new OptIn for userId=' + user.id)
|
||||||
optInCode = newEmailOptIn(userId)
|
optInCode = newEmailOptIn(user.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user.emailChecked) {
|
||||||
|
optInCode.emailOptInTypeId = optInType
|
||||||
}
|
}
|
||||||
optInCode.emailOptInTypeId = optInType
|
|
||||||
await LoginEmailOptIn.save(optInCode).catch(() => {
|
await LoginEmailOptIn.save(optInCode).catch(() => {
|
||||||
logger.error('Unable to save optin code= ' + optInCode)
|
logger.error('Unable to save optin code= ' + optInCode)
|
||||||
throw new Error('Unable to save optin code.')
|
throw new Error('Unable to save optin code.')
|
||||||
})
|
})
|
||||||
logger.debug(`checkOptInCode...successful: ${optInCode} for userid=${userId}`)
|
logger.debug(`checkOptInCode...successful: ${optInCode} for userid=${user.id}`)
|
||||||
return optInCode
|
return optInCode
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -493,7 +496,7 @@ export class UserResolver {
|
|||||||
userId: user.id,
|
userId: user.id,
|
||||||
})
|
})
|
||||||
|
|
||||||
optInCode = await checkOptInCode(optInCode, user.id, OptInType.EMAIL_OPT_IN_RESET_PASSWORD)
|
optInCode = await checkOptInCode(optInCode, user, OptInType.EMAIL_OPT_IN_RESET_PASSWORD)
|
||||||
logger.info(`optInCode for ${email}=${optInCode}`)
|
logger.info(`optInCode for ${email}=${optInCode}`)
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const emailSent = await sendResetPasswordEmailMailer({
|
const emailSent = await sendResetPasswordEmailMailer({
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { MiddlewareFn } from 'type-graphql'
|
|||||||
import { /* klicktippSignIn, */ getKlickTippUser } from '@/apis/KlicktippController'
|
import { /* klicktippSignIn, */ getKlickTippUser } from '@/apis/KlicktippController'
|
||||||
import { KlickTipp } from '@model/KlickTipp'
|
import { KlickTipp } from '@model/KlickTipp'
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
|
import { klickTippLogger as logger } from '@/server/logger'
|
||||||
|
|
||||||
// export const klicktippRegistrationMiddleware: MiddlewareFn = async (
|
// export const klicktippRegistrationMiddleware: MiddlewareFn = async (
|
||||||
// // Only for demo
|
// // Only for demo
|
||||||
@ -29,7 +30,9 @@ export const klicktippNewsletterStateMiddleware: MiddlewareFn = async (
|
|||||||
if (klickTippUser) {
|
if (klickTippUser) {
|
||||||
klickTipp = new KlickTipp(klickTippUser)
|
klickTipp = new KlickTipp(klickTippUser)
|
||||||
}
|
}
|
||||||
} catch (err) {}
|
} catch (err) {
|
||||||
|
logger.error(`There is no user for (email='${result.email}') ${err}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
result.klickTipp = klickTipp
|
result.klickTipp = klickTipp
|
||||||
return result
|
return result
|
||||||
|
|||||||
@ -12,7 +12,8 @@ log4js.configure(options)
|
|||||||
|
|
||||||
const apolloLogger = log4js.getLogger('apollo')
|
const apolloLogger = log4js.getLogger('apollo')
|
||||||
const backendLogger = log4js.getLogger('backend')
|
const backendLogger = log4js.getLogger('backend')
|
||||||
|
const klickTippLogger = log4js.getLogger('klicktipp')
|
||||||
|
|
||||||
backendLogger.addContext('user', 'unknown')
|
backendLogger.addContext('user', 'unknown')
|
||||||
|
|
||||||
export { apolloLogger, backendLogger }
|
export { apolloLogger, backendLogger, klickTippLogger }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user