Skip to content

Instantly share code, notes, and snippets.

View jianhandev's full-sized avatar

LI JIANHAN jianhandev

  • National University of Singapore
  • Singapore
View GitHub Profile
# 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