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 {
@Query(() => User)
@UseMiddleware(klicktippNewsletterStateMiddleware)
async login(
@Args() { email, password }: UnsecureLoginArgs,
@Ctx() context: any,
): Promise<User> {
async login(@Args() { email, password }: UnsecureLoginArgs, @Ctx() context: any): Promise<User> {
email = email.trim().toLowerCase()
const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', {
email,
password,
})
const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password })
// if there is no user, throw an authentication error
if (!result.success) {

View File

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