authentication-zero 2.16.28 → 2.16.29

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: 195bf86bdef228aa0ad627d9fc82850b6b9fd4dca4ce08dec69b860f5fbd03fd
4
- data.tar.gz: 65501f9800f6c3f7116a94926404c481bcfe213dce0c507dfc05a0098f65f62a
3
+ metadata.gz: b1ca404e21064ef6548cb7fd3dd0d62259e55cc1712ccbd37266de5a5009cae4
4
+ data.tar.gz: 5470a05b5863a993997d9cc17d7c104d53ed5f8277182f029f9831e8c51be6fa
5
5
  SHA512:
6
- metadata.gz: 3135d5d608a9d99a649b86a0ad476f61967a1ad06bafdce20af390412afdc73b5ff14706a8be282f927cb38a992d70e4d2d3ca23e2d9e5dd5f552441c0552d5b
7
- data.tar.gz: f5e7499825798498e31fe995b1a8dd4813308f0d8773d25bcacd4d3cd78d201a3b9f293c8e4cfa2619f61adad78e3e2f18c41856c537f913ff3787cd87f5448d
6
+ metadata.gz: 044747617b27c4a38aae36572364ce3e64483fe15a7ca44518209e1db30a2207269b92edb28ce690449249c728073d5d661eb4df15a19afa8cceeaa20eb763fd
7
+ data.tar.gz: 47ed5cb9bcef11dfc71a4ed3c761b5a30d346c0b1923e52f1e71f24d5c1703b23b7e52552cd12f7ca9ad6e9031d3cc8a6a5e4a124e0d3a8f6753fdbea202cd13
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Authentication Zero 2.16.29 ##
2
+
3
+ * Replaced session with session_record, it has a conflict on rails 7.1 (bug-fix)
4
+
1
5
  ## Authentication Zero 2.16.25 ##
2
6
 
3
7
  * Add new option to refresh otp secret
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.16.28)
4
+ authentication-zero (2.16.29)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.16.28"
2
+ VERSION = "2.16.29"
3
3
  end
@@ -6,8 +6,8 @@ class ApplicationController < ActionController::API
6
6
 
7
7
  private
8
8
  def authenticate
9
- if session = authenticate_with_http_token { |token, _| Session.find_signed(token) }
10
- Current.session = session
9
+ if session_record = authenticate_with_http_token { |token, _| Session.find_signed(token) }
10
+ Current.session = session_record
11
11
  else
12
12
  request_http_token_authentication
13
13
  end
@@ -4,8 +4,8 @@ class ApplicationController < ActionController::Base
4
4
 
5
5
  private
6
6
  def authenticate
7
- if session = Session.find_by_id(cookies.signed[:session_token])
8
- Current.session = session
7
+ if session_record = Session.find_by_id(cookies.signed[:session_token])
8
+ Current.session = session_record
9
9
  else
10
10
  redirect_to sign_in_path
11
11
  end
@@ -3,8 +3,8 @@ class MasqueradesController < ApplicationController
3
3
  before_action :set_user
4
4
 
5
5
  def create
6
- session = @user.sessions.create!
7
- cookies.signed.permanent[:session_token] = { value: session.id, httponly: true }
6
+ session_record = @user.sessions.create!
7
+ cookies.signed.permanent[:session_token] = { value: session_record.id, httponly: true }
8
8
 
9
9
  redirect_to root_path, notice: "Signed in successfully"
10
10
  end
@@ -9,8 +9,8 @@ class RegistrationsController < ApplicationController
9
9
  @user = User.new(user_params)
10
10
 
11
11
  if @user.save
12
- session = @user.sessions.create!
13
- cookies.signed.permanent[:session_token] = { value: session.id, httponly: true }
12
+ session_record = @user.sessions.create!
13
+ cookies.signed.permanent[:session_token] = { value: session_record.id, httponly: true }
14
14
 
15
15
  send_email_verification
16
16
  redirect_to root_path, notice: "Welcome! You have signed up successfully"
@@ -6,8 +6,8 @@ class Sessions::OmniauthController < ApplicationController
6
6
  @user = User.create_with(user_params).find_or_initialize_by(omniauth_params)
7
7
 
8
8
  if @user.save
9
- session = @user.sessions.create!
10
- cookies.signed.permanent[:session_token] = { value: session.id, httponly: true }
9
+ session_record = @user.sessions.create!
10
+ cookies.signed.permanent[:session_token] = { value: session_record.id, httponly: true }
11
11
 
12
12
  redirect_to root_path, notice: "Signed in successfully"
13
13
  else
@@ -10,8 +10,8 @@ class Sessions::PasswordlessesController < ApplicationController
10
10
  end
11
11
 
12
12
  def edit
13
- @session = @user.sessions.create!
14
- cookies.signed.permanent[:session_token] = { value: @session.id, httponly: true }
13
+ session_record = @user.sessions.create!
14
+ cookies.signed.permanent[:session_token] = { value: session_record.id, httponly: true }
15
15
 
16
16
  revoke_tokens; redirect_to(root_path, notice: "Signed in successfully")
17
17
  end
@@ -3,10 +3,10 @@ class Sessions::SudosController < ApplicationController
3
3
  end
4
4
 
5
5
  def create
6
- session = Current.session
6
+ session_record = Current.session
7
7
 
8
- if session.user.authenticate(params[:password])
9
- session.sudo.mark; redirect_to(params[:proceed_to_url])
8
+ if session_record.user.authenticate(params[:password])
9
+ session_record.sudo.mark; redirect_to(params[:proceed_to_url])
10
10
  else
11
11
  redirect_to new_sessions_sudo_path(proceed_to_url: params[:proceed_to_url]), alert: "The password you entered is incorrect"
12
12
  end
@@ -22,8 +22,8 @@ class TwoFactorAuthentication::Challenge::RecoveryCodesController < ApplicationC
22
22
  end
23
23
 
24
24
  def sign_in_and_redirect_to_root
25
- session = @user.sessions.create!
26
- cookies.signed.permanent[:session_token] = { value: session.id, httponly: true }
25
+ session_record = @user.sessions.create!
26
+ cookies.signed.permanent[:session_token] = { value: session_record.id, httponly: true }
27
27
 
28
28
  redirect_to root_path, notice: "Signed in successfully"
29
29
  end
@@ -26,8 +26,8 @@ class TwoFactorAuthentication::Challenge::SecurityKeysController < ApplicationCo
26
26
  end
27
27
 
28
28
  def sign_in_and_redirect_to_root
29
- session = @user.sessions.create!
30
- cookies.signed.permanent[:session_token] = { value: session.id, httponly: true }
29
+ session_record = @user.sessions.create!
30
+ cookies.signed.permanent[:session_token] = { value: session_record.id, httponly: true }
31
31
 
32
32
  render json: { status: "ok", location: root_url }, status: :created
33
33
  end
@@ -24,8 +24,8 @@ class TwoFactorAuthentication::Challenge::TotpsController < ApplicationControlle
24
24
  end
25
25
 
26
26
  def sign_in_and_redirect_to_root
27
- session = @user.sessions.create!
28
- cookies.signed.permanent[:session_token] = { value: session.id, httponly: true }
27
+ session_record = @user.sessions.create!
28
+ cookies.signed.permanent[:session_token] = { value: session_record.id, httponly: true }
29
29
 
30
30
  redirect_to root_path, notice: "Signed in successfully"
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.16.28
4
+ version: 2.16.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-22 00:00:00.000000000 Z
11
+ date: 2023-05-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: