user schema and password hash method updated
This commit is contained in:
parent
74c4c09320
commit
fbb8a0e93d
|
@ -1,11 +1,11 @@
|
||||||
from passlib.hash import pbkdf2_sha256
|
from passlib.hash import bcrypt
|
||||||
|
|
||||||
|
|
||||||
class Password:
|
class Password:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def encode(password: str) -> str:
|
def encode(password: str) -> str:
|
||||||
return pbkdf2_sha256.hash(password)
|
return bcrypt.hash(password)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def verify(password: str, other: str) -> bool:
|
def verify(password: str, other: str) -> bool:
|
||||||
return pbkdf2_sha256.verify(password, other)
|
return bcrypt.verify(password, other)
|
||||||
|
|
|
@ -116,7 +116,6 @@ type Subscription {
|
||||||
############################################ Entities
|
############################################ Entities
|
||||||
|
|
||||||
type Role {
|
type Role {
|
||||||
id: Int!
|
|
||||||
name: String!
|
name: String!
|
||||||
org: String!
|
org: String!
|
||||||
level: Int! # 1-8
|
level: Int! # 1-8
|
||||||
|
@ -124,16 +123,19 @@ type Role {
|
||||||
}
|
}
|
||||||
|
|
||||||
type User {
|
type User {
|
||||||
createdAt: DateTime!
|
username: String! # email
|
||||||
email: String
|
email: String
|
||||||
|
password: String
|
||||||
|
viewname: String # to display
|
||||||
|
userpic: String
|
||||||
|
links: [String]
|
||||||
emailConfirmed: Boolean
|
emailConfirmed: Boolean
|
||||||
id: Int!
|
id: Int!
|
||||||
muted: Boolean
|
muted: Boolean
|
||||||
rating: Int
|
rating: Int
|
||||||
roles: [Role!]!
|
roles: [Role!]!
|
||||||
|
createdAt: DateTime!
|
||||||
updatedAt: DateTime!
|
updatedAt: DateTime!
|
||||||
username: String
|
|
||||||
userpic: String
|
|
||||||
wasOnlineAt: DateTime
|
wasOnlineAt: DateTime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user