Class: AuthenticateUser

Inherits:
Object
  • Object
show all
Includes:
SimpleCommand
Defined in:
app/commands/authenticate_user.rb

Defined Under Namespace

Classes: AccessDenied

Instance Method Summary collapse

Constructor Details

#initialize(email, password) ⇒ AuthenticateUser

Returns a new instance of AuthenticateUser.



9
10
11
12
# File 'app/commands/authenticate_user.rb', line 9

def initialize(email, password)
    @email = email
    @password = password
end

Instance Method Details

#callObject



14
15
16
# File 'app/commands/authenticate_user.rb', line 14

def call
    JsonWebToken.encode(user_id: api_user.id) if api_user
end