Method: Mints::AdminBaseController#mints_user_login

Defined in:
lib/mints/controllers/admin_base_controller.rb

#mints_user_login(email, password) ⇒ Object

Mints user Login.

Starts a user session in mints.cloud and set a session cookie

[View source]

19
20
21
22
23
24
25
26
# File 'lib/mints/controllers/admin_base_controller.rb', line 19

def (email, password)
    # Login in mints
    response = @mints_user.(email, password)
    # Get session token from response
    session_token = response['api_token']
    # Set a permanent cookie with the session token
    cookies[:mints_user_session_token] = { value: session_token, secure: true, httponly: true, expires: 1.day }
end