init commit
This commit is contained in:
19
users/users.py
Normal file
19
users/users.py
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
class User(object):
|
||||
def __init__(self, id, username, password):
|
||||
self.id = id
|
||||
self.username = username
|
||||
self.password = password
|
||||
|
||||
def __str__(self):
|
||||
return "User(id='%s')" % self.id
|
||||
|
||||
user = User(1, 'user', 'password')
|
||||
def authenticate(username, password):
|
||||
if username == user.username and password == user.password:
|
||||
return user
|
||||
|
||||
def identity(payload):
|
||||
return user
|
||||
|
||||
|
||||
Reference in New Issue
Block a user