authentication-zero 2.16.27 → 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: 396a7e8c26e49c9b91d5b349155eb5d2cb4dbbd2012bb2a89977cb66c7446e39
4
- data.tar.gz: 11cdeee70ab80f387208315d585ed0dd0f9cee431b5405e67f77d009bdbfe80d
3
+ metadata.gz: b1ca404e21064ef6548cb7fd3dd0d62259e55cc1712ccbd37266de5a5009cae4
4
+ data.tar.gz: 5470a05b5863a993997d9cc17d7c104d53ed5f8277182f029f9831e8c51be6fa
5
5
  SHA512:
6
- metadata.gz: 2be5682d873fdbc960630bc19f5210242813584f1af36667d8737944633436de50c1d72875a493a902dea041c062978805878cf4b4ef5d88b4dd20665d1ad393
7
- data.tar.gz: 78d17cb5827821a1a30dff4133325d1fd46eab620c6785dfcae0e58c6ac815ff8d21fd3bfecf9b069ecf70f90e8146d6755d58b59863ad6e01d3f1208eafb5a8
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.27)
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.27"
2
+ VERSION = "2.16.29"
3
3
  end
@@ -62,14 +62,14 @@ class AuthenticationGenerator < Rails::Generators::Base
62
62
  end
63
63
 
64
64
  def create_migrations
65
+ migration_template "migrations/create_users_migration.rb", "#{db_migrate_path}/create_users.rb"
66
+ migration_template "migrations/create_sessions_migration.rb", "#{db_migrate_path}/create_sessions.rb"
67
+ migration_template "migrations/create_password_reset_tokens_migration.rb", "#{db_migrate_path}/create_password_reset_tokens.rb"
65
68
  migration_template "migrations/create_email_verification_tokens_migration.rb", "#{db_migrate_path}/create_email_verification_tokens.rb"
66
69
  migration_template "migrations/create_events_migration.rb", "#{db_migrate_path}/create_events.rb" if options.trackable?
67
- migration_template "migrations/create_password_reset_tokens_migration.rb", "#{db_migrate_path}/create_password_reset_tokens.rb"
68
70
  migration_template "migrations/create_recovery_codes_migration.rb", "#{db_migrate_path}/create_recovery_codes.rb" if two_factor?
69
71
  migration_template "migrations/create_security_keys_migration.rb", "#{db_migrate_path}/create_security_keys.rb" if webauthn?
70
- migration_template "migrations/create_sessions_migration.rb", "#{db_migrate_path}/create_sessions.rb"
71
72
  migration_template "migrations/create_sign_in_tokens_migration.rb", "#{db_migrate_path}/create_sign_in_tokens_migration.rb" if passwordless?
72
- migration_template "migrations/create_users_migration.rb", "#{db_migrate_path}/create_users.rb"
73
73
  end
74
74
 
75
75
  def create_models
@@ -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.27
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-19 00:00:00.000000000 Z
11
+ date: 2023-05-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: