prx_auth-rails 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fedf5cbb7d3255c080ab645aea53038bd7cf2e9bae4c4852841df32278a44e3b
|
4
|
+
data.tar.gz: a33847b1bbf64bd0ed4d4839003edc2cf8f0cbc72731ffdf98828ae49e0c966e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 243d784cb14623fe63af154eb6c7146c767cb96f0edcb19b4977ae66d70dc3db5c6137448b1c82a892316a0a3754d9886429d0861a20593a43fa18749b7b5ef9
|
7
|
+
data.tar.gz: 2844850399e1525cae1257cdd3e9f46f2ed0336ef4bf9e30b4737e0e535e0198f7f284855821b2bf092d1daf3afda6f6ea12a2bcb2517f37bd2b8a3c9b8a7661
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PrxAuth::Rails
|
2
4
|
class SessionsController < ApplicationController
|
3
5
|
include PrxAuth::Rails::Engine.routes.url_helpers
|
@@ -5,8 +7,9 @@ module PrxAuth::Rails
|
|
5
7
|
skip_before_action :authenticate!
|
6
8
|
|
7
9
|
before_action :set_nonce!, only: [:new, :show]
|
10
|
+
before_action :set_after_sign_in_path
|
8
11
|
|
9
|
-
ID_NONCE_SESSION_KEY = 'id_prx_openid_nonce'
|
12
|
+
ID_NONCE_SESSION_KEY = 'id_prx_openid_nonce'
|
10
13
|
|
11
14
|
def new
|
12
15
|
config = PrxAuth::Rails.configuration
|
@@ -8,6 +8,7 @@ module PrxAuth
|
|
8
8
|
|
9
9
|
PRX_AUTH_ENV_KEY = 'prx.auth'.freeze
|
10
10
|
PRX_JWT_SESSION_KEY = 'prx.auth.jwt'.freeze
|
11
|
+
# subtracted from the JWT ttl
|
11
12
|
PRX_JWT_REFRESH_TTL = 300.freeze
|
12
13
|
PRX_ACCOUNT_MAPPING_SESSION_KEY = 'prx.auth.account.mapping'.freeze
|
13
14
|
PRX_USER_INFO_SESSION_KEY = 'prx.auth.info'.freeze
|
@@ -19,8 +20,13 @@ module PrxAuth
|
|
19
20
|
session.delete(PRX_JWT_SESSION_KEY)
|
20
21
|
session.delete(PRX_ACCOUNT_MAPPING_SESSION_KEY)
|
21
22
|
session.delete(PRX_USER_INFO_SESSION_KEY)
|
23
|
+
nil
|
24
|
+
end
|
25
|
+
|
26
|
+
def set_after_sign_in_path
|
27
|
+
return if self.class == PrxAuth::Rails::SessionsController
|
28
|
+
|
22
29
|
session[PRX_REFRESH_BACK_KEY] = request.fullpath
|
23
|
-
redirect_to PrxAuth::Rails::Engine.routes.url_helpers.new_sessions_path
|
24
30
|
end
|
25
31
|
|
26
32
|
def prx_jwt
|
@@ -73,7 +79,7 @@ module PrxAuth
|
|
73
79
|
end
|
74
80
|
|
75
81
|
def after_sign_in_user_redirect
|
76
|
-
session
|
82
|
+
session[PRX_REFRESH_BACK_KEY]
|
77
83
|
end
|
78
84
|
|
79
85
|
def sign_out_user
|
@@ -71,7 +71,9 @@ module PrxAuth::Rails
|
|
71
71
|
session[@refresh_back_key] = '/lets/go/here?okay'
|
72
72
|
post :create, params: @token_params, format: :json
|
73
73
|
|
74
|
-
|
74
|
+
# A trailing log of the 'last' page
|
75
|
+
assert session[@refresh_back_key] == '/lets/go/here?okay'
|
76
|
+
|
75
77
|
assert response.code == '302'
|
76
78
|
assert response.headers['Location'].ends_with?('/lets/go/here?okay')
|
77
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prx_auth-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Rhoden
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -270,7 +270,7 @@ homepage: https://github.com/PRX/prx_auth-rails
|
|
270
270
|
licenses:
|
271
271
|
- MIT
|
272
272
|
metadata: {}
|
273
|
-
post_install_message:
|
273
|
+
post_install_message:
|
274
274
|
rdoc_options: []
|
275
275
|
require_paths:
|
276
276
|
- lib
|
@@ -285,8 +285,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
285
|
- !ruby/object:Gem::Version
|
286
286
|
version: '0'
|
287
287
|
requirements: []
|
288
|
-
|
289
|
-
|
288
|
+
rubyforge_project:
|
289
|
+
rubygems_version: 2.7.6.2
|
290
|
+
signing_key:
|
290
291
|
specification_version: 4
|
291
292
|
summary: Rails integration for next generation PRX Authorization system.
|
292
293
|
test_files:
|