Method: UserAuthHelper#cxf_user_magic_link_login
- Defined in:
- lib/cxf/helpers/user_auth_helper.rb
#cxf_user_magic_link_login(hash) ⇒ Object
Cxf user Login.
Starts a user session in cxf.cloud and set a session cookie
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/cxf/helpers/user_auth_helper.rb', line 42 def cxf_user_magic_link_login(hash) # Login in cxf response = @cxf_user.magic_link_login(hash) if response['data'] # Set a cookie with the session token ["cxf_user_session_token"] = { value: response['data']['access_token'], secure: true, httponly: true } ["cxf_user_refresh_token"] = { value: response['data']['refresh_token'], secure: true, httponly: true } redirect_to response['data']['redirect_url'] || '/' else redirect_to '/' end end |