mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
always write send confirmation event
This commit is contained in:
parent
1792d10733
commit
dfbfefd73a
@ -63,6 +63,7 @@ import {
|
|||||||
EVENT_USER_ROLE_SET,
|
EVENT_USER_ROLE_SET,
|
||||||
EVENT_ADMIN_USER_ROLE_SET,
|
EVENT_ADMIN_USER_ROLE_SET,
|
||||||
EVENT_ADMIN_USER_DELETE,
|
EVENT_ADMIN_USER_DELETE,
|
||||||
|
EVENT_ADMIN_USER_UNDELETE,
|
||||||
} from '@/event/Event'
|
} from '@/event/Event'
|
||||||
import { getUserCreations } from './util/creations'
|
import { getUserCreations } from './util/creations'
|
||||||
import { isValidPassword } from '@/password/EncryptorUtils'
|
import { isValidPassword } from '@/password/EncryptorUtils'
|
||||||
@ -767,7 +768,10 @@ export class UserResolver {
|
|||||||
|
|
||||||
@Authorized([RIGHTS.ADMIN_UNDELETE_USER])
|
@Authorized([RIGHTS.ADMIN_UNDELETE_USER])
|
||||||
@Mutation(() => Date, { nullable: true })
|
@Mutation(() => Date, { nullable: true })
|
||||||
async unDeleteUser(@Arg('userId', () => Int) userId: number, @Ctx() context: Context,): Promise<Date | null> {
|
async unDeleteUser(
|
||||||
|
@Arg('userId', () => Int) userId: number,
|
||||||
|
@Ctx() context: Context,
|
||||||
|
): Promise<Date | null> {
|
||||||
const user = await DbUser.findOne({ id: userId }, { withDeleted: true })
|
const user = await DbUser.findOne({ id: userId }, { withDeleted: true })
|
||||||
if (!user) {
|
if (!user) {
|
||||||
throw new LogError('Could not find user with given ID', userId)
|
throw new LogError('Could not find user with given ID', userId)
|
||||||
@ -810,9 +814,8 @@ export class UserResolver {
|
|||||||
// In case EMails are disabled log the activation link for the user
|
// In case EMails are disabled log the activation link for the user
|
||||||
if (!emailSent) {
|
if (!emailSent) {
|
||||||
logger.info(`Account confirmation link: ${activationLink}`)
|
logger.info(`Account confirmation link: ${activationLink}`)
|
||||||
} else {
|
|
||||||
await EVENT_ADMIN_SEND_CONFIRMATION_EMAIL(user, getUser(context))
|
|
||||||
}
|
}
|
||||||
|
await EVENT_ADMIN_SEND_CONFIRMATION_EMAIL(user, getUser(context))
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user