This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This class authenticates a valid user by generating a JWT token | |
class AuthenticateUser | |
def initialize(email, password) | |
@email, @password = email, password | |
end | |
def token | |
JsonWebToken.encode({ user_id: user.id }) | |
end |