mirror of
https://github.com/IT4Change/gradido.git
synced 2026-04-06 01:25:28 +00:00
logs for debug
This commit is contained in:
parent
e1596ad78b
commit
b7cb158369
@ -10,8 +10,9 @@ import CONFIG from '../../config'
|
|||||||
|
|
||||||
const apiPost = async (url: string, payload: any): Promise<any> => {
|
const apiPost = async (url: string, payload: any): Promise<any> => {
|
||||||
try {
|
try {
|
||||||
|
console.log(url, payload)
|
||||||
const result = await axios.post(url, payload)
|
const result = await axios.post(url, payload)
|
||||||
console.log(result)
|
console.log('-----', result)
|
||||||
if (result.status !== 200) {
|
if (result.status !== 200) {
|
||||||
throw new Error('HTTP Status Error ' + result.status)
|
throw new Error('HTTP Status Error ' + result.status)
|
||||||
}
|
}
|
||||||
@ -23,6 +24,7 @@ const apiPost = async (url: string, payload: any): Promise<any> => {
|
|||||||
}
|
}
|
||||||
return { success: true, result }
|
return { success: true, result }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
return { success: false, result: error }
|
return { success: false, result: error }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,7 +44,7 @@ export class UserResolver {
|
|||||||
@Query(() => String)
|
@Query(() => String)
|
||||||
async login(@Arg('email') email: string, @Arg('password') password: string): Promise<string> {
|
async login(@Arg('email') email: string, @Arg('password') password: string): Promise<string> {
|
||||||
email = email.trim().toLowerCase()
|
email = email.trim().toLowerCase()
|
||||||
|
console.log(email, password, CONFIG.LOGIN_API_URL)
|
||||||
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 there is no user, throw an authentication error
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user