mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fixed login and schema
This commit is contained in:
parent
30d4318d17
commit
77e77229b9
@ -98,11 +98,12 @@ export const resolvers = {
|
||||
const session = driver.session()
|
||||
return session.run(
|
||||
'MATCH (user:User {email: $userEmail}) ' +
|
||||
'RETURN user {.id, .slug, .name, .avatar, .locationId, .about, .email, .password, .role} as user LIMIT 1', { userEmail: email })
|
||||
'RETURN user {.id, .slug, .name, .avatar, .locationName, .about, .email, .password, .role} as user LIMIT 1', {
|
||||
userEmail: email
|
||||
})
|
||||
.then(async (result) => {
|
||||
session.close()
|
||||
const [currentUser] = await result.records.map(function (record) {
|
||||
console.log(record.get('user'))
|
||||
return record.get('user')
|
||||
})
|
||||
if (currentUser && await bcrypt.compareSync(password, currentUser.password)) {
|
||||
|
||||
@ -13,7 +13,7 @@ type LoggedInUser {
|
||||
avatar:String!
|
||||
email: String!
|
||||
role: String!
|
||||
locationId: String
|
||||
locationName: String
|
||||
about: String
|
||||
token: String!
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user