do not use remember_me, set cookie expiration
This commit is contained in:
@@ -47,8 +47,6 @@ class Api::UserTokenController < Knock::AuthTokenController
|
||||
private
|
||||
|
||||
def sign_in_user
|
||||
if sign_in(entity)
|
||||
remember_me(entity)
|
||||
end
|
||||
sign_in(entity)
|
||||
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.body).to match record_not_found
|
||||
expect(cookie_data).to eq nil
|
||||
expect(rtfuser_cookie).to eq nil
|
||||
end
|
||||
|
||||
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).to match token_response
|
||||
expect(cookie_data).not_to eq nil
|
||||
expect(rtfuser_cookie).not_to eq nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -62,8 +60,4 @@ RSpec.describe Api::UserTokenController, type: :request do
|
||||
def cookie_data
|
||||
cookies[:_easy_release_session]
|
||||
end
|
||||
|
||||
def rtfuser_cookie
|
||||
cookies[:_rtfuser]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user