do not use remember_me, set cookie expiration
This commit is contained in:
@@ -47,8 +47,6 @@ class Api::UserTokenController < Knock::AuthTokenController
|
|||||||
private
|
private
|
||||||
|
|
||||||
def sign_in_user
|
def sign_in_user
|
||||||
if sign_in(entity)
|
sign_in(entity)
|
||||||
remember_me(entity)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
1
config/initializers/session_cookie.rb
Normal file
1
config/initializers/session_cookie.rb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Rails.application.config.session_store :cookie_store, key: '_easy_release_session', expire_after: 1.month
|
||||||
@@ -13,7 +13,6 @@ RSpec.describe Api::UserTokenController, type: :request do
|
|||||||
expect(response).to be_successful
|
expect(response).to be_successful
|
||||||
expect(response.body).to match record_not_found
|
expect(response.body).to match record_not_found
|
||||||
expect(cookie_data).to eq nil
|
expect(cookie_data).to eq nil
|
||||||
expect(rtfuser_cookie).to eq nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sends token and cookie if credentials are correct' do
|
it 'sends token and cookie if credentials are correct' do
|
||||||
@@ -23,7 +22,6 @@ RSpec.describe Api::UserTokenController, type: :request do
|
|||||||
expect(response.body).not_to match record_not_found
|
expect(response.body).not_to match record_not_found
|
||||||
expect(response.body).to match token_response
|
expect(response.body).to match token_response
|
||||||
expect(cookie_data).not_to eq nil
|
expect(cookie_data).not_to eq nil
|
||||||
expect(rtfuser_cookie).not_to eq nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -62,8 +60,4 @@ RSpec.describe Api::UserTokenController, type: :request do
|
|||||||
def cookie_data
|
def cookie_data
|
||||||
cookies[:_easy_release_session]
|
cookies[:_easy_release_session]
|
||||||
end
|
end
|
||||||
|
|
||||||
def rtfuser_cookie
|
|
||||||
cookies[:_rtfuser]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user