send email for password reset

This commit is contained in:
Moriz Wahl 2021-07-14 20:22:15 +02:00
parent ae4edf4605
commit 2ab92d1a53

View File

@ -1,5 +1,5 @@
// import jwt from 'jsonwebtoken'
import { Resolver, Query, /* Mutation, */ Args } from 'type-graphql'
import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql'
import CONFIG from '../../config'
import { LoginResponse } from '../models/User'
import { UnsecureLoginArgs } from '../inputs/LoginUserInput'
@ -43,6 +43,16 @@ export class UserResolver {
},
}
// forgot password request
/*
@Query(() => null)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async sendEmail(@Arg() email: String): Promise<any> {
const result = await apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', { email })
return
}
*/
// create and return the json web token
// The expire doesn't help us here. The client needs to track when the token expires on its own,
// since every action prolongs the time the session is valid.