Method: Mints::BaseController#mints_contact_login
- Defined in:
- lib/mints/controllers/base_controller.rb
#mints_contact_login(email, password) ⇒ Object
Mints Contact Login.
Starts a contact session in mints.cloud and set a session cookie
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mints/controllers/base_controller.rb', line 22 def mints_contact_login(email, password) # Login in mints response = @mints_contact.login(email, password) # Get session token from response session_token = response['session_token'] id_token = response['contact']['id_token'] # Set a permanent cookie with the session token .permanent[:mints_contact_session_token] = session_token .permanent[:mints_contact_id] = id_token @contact_token = id_token end |