class Laspatule::Services::Users

Defined in:

laspatule/services/users.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(repository : Repositories::Users, mail : Mail) #

[View source]

Instance Method Detail

def auth(email : String, password : String) : Models::User | Nil #

Authenticates a user and returns its.

If the authentication fails, return nil.


[View source]
def create(user : Models::CreateUser) : Nil #

Create a new user.

Create the user, then send their an email to activate its account.


[View source]
def create_access_token(user : Models::User) : String #

Creates a new access token for this user and returns it.


[View source]
def get_by_access_token?(access_token : String) : Models::User | Nil #

Gets a user by its access token.


[View source]