This commit is contained in:
einhornimmond 2021-10-10 15:29:44 +02:00
parent 546d371139
commit 909c7e3a9a
2 changed files with 3 additions and 9 deletions

View File

@ -31,15 +31,9 @@ import { UserRepository } from '../../typeorm/repository/User'
export class UserResolver { export class UserResolver {
@Query(() => User) @Query(() => User)
@UseMiddleware(klicktippNewsletterStateMiddleware) @UseMiddleware(klicktippNewsletterStateMiddleware)
async login( async login(@Args() { email, password }: UnsecureLoginArgs, @Ctx() context: any): Promise<User> {
@Args() { email, password }: UnsecureLoginArgs,
@Ctx() context: any,
): Promise<User> {
email = email.trim().toLowerCase() email = email.trim().toLowerCase()
const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password })
email,
password,
})
// if there is no user, throw an authentication error // if there is no user, throw an authentication error
if (!result.success) { if (!result.success) {

View File

@ -39,7 +39,7 @@ with:
{ {
"email": "max.musterman@gmail.de", "email": "max.musterman@gmail.de",
"username": "Maxilein", "username": "Maxilein",
"password": "123abcDE&" "password": "123abcDE&",
"hasElopage": true "hasElopage": true
} }
``` ```