class Laspatule::Services::Users
- Laspatule::Services::Users
- Reference
- Object
Defined in:
laspatule/services/users.crConstructors
Instance Method Summary
-
#auth(email : String, password : String) : Models::User | Nil
Authenticates a user and returns its.
-
#create(user : Models::CreateUser) : Nil
Create a new user.
-
#create_access_token(user : Models::User) : String
Creates a new access token for this user and returns it.
-
#get_by_access_token?(access_token : String) : Models::User | Nil
Gets a user by its access token.
Constructor Detail
Instance Method Detail
def auth(email : String, password : String) : Models::User | Nil
#
Authenticates a user and returns its.
If the authentication fails, return nil.
def create(user : Models::CreateUser) : Nil
#
Create a new user.
Create the user, then send their an email to activate its account.
def create_access_token(user : Models::User) : String
#
Creates a new access token for this user and returns it.
def get_by_access_token?(access_token : String) : Models::User | Nil
#
Gets a user by its access token.