user and role controllers
This commit is contained in:
parent
6865507545
commit
ab01fc2f76
25 changed files with 769 additions and 26 deletions
|
@ -25,7 +25,7 @@ import UserPermissionCommandHandler from "../command/userPermissionCommandHandle
|
|||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function inviteUser(req: Request, res: Response): Promise<any> {
|
||||
export async function inviteUser(req: Request, res: Response, isInvite: boolean = true): Promise<any> {
|
||||
let origin = req.headers.origin;
|
||||
let username = req.body.username;
|
||||
let mail = req.body.mail;
|
||||
|
@ -62,7 +62,7 @@ export async function inviteUser(req: Request, res: Response): Promise<any> {
|
|||
await mailhelper.sendMail(
|
||||
mail,
|
||||
`Email Bestätigung für Mitglieder Admin-Portal von ${CLUB_NAME}`,
|
||||
`Öffne folgenden Link: ${origin}/setup/verify?mail=${mail}&token=${token}`
|
||||
`Öffne folgenden Link: ${origin}/${isInvite ? "invite" : "setup"}/verify?mail=${mail}&token=${token}`
|
||||
);
|
||||
|
||||
res.sendStatus(204);
|
||||
|
@ -114,8 +114,6 @@ export async function finishInvite(req: Request, res: Response, grantAdmin: bool
|
|||
window: 2,
|
||||
});
|
||||
|
||||
console.log(valid);
|
||||
|
||||
if (!valid) {
|
||||
throw new UnauthorizedRequestException("Token not valid or expired");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue