authentication-zero 2.3.5 → 2.3.6

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: bdd056761c0aff038c46100fcbf3565da08adf2d020e250fddee0d8cc3ee27c4
4
- data.tar.gz: 17effffa54f3a3d8dd017ac98804935a92e7bd24a540516ba2f0a7880326280a
3
+ metadata.gz: 3cd20da7b0f56b6c19dcc3133bd3423222705fd77b64b6754284b2d0a34b795d
4
+ data.tar.gz: a4fecf9bdff5dc659b584326323ac6b53840d4bc9e0e0096f957d68d34ce521b
5
5
  SHA512:
6
- metadata.gz: f7a1825d9930a6ca5f61f04076f9f859f75c6d8a496a4cb79abcdb7b46879de13dfc4e92e6db851413ce531b069fcae5c1981529bb6d8706705597fdeb7a040d
7
- data.tar.gz: ee57e00000cd2cebd8b2f662392ac7324b24074fb79b47c9917e80d413946fecafa3fbd6b6b867bedf94480725698b4d1ec78c1606610e3373463cbfeba9b509
6
+ metadata.gz: 9b16ae0a95f453247ea61761bd50bac1abb196980ec8ec56cae879e58239b3f80ffcbb43cde1de81ac4bd50efecaaada6416890a9a04090c3c558c3ffa28870d
7
+ data.tar.gz: 4563fc71ef94b056bd823dca4dee733d0a337796b995d886e9eeca5cd82706deb43e108857dd70e1bedf1b29a67c0eb1dd08ef2f9fc231a1c0ef51f3c74f17e8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.3.5)
4
+ authentication-zero (2.3.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.3.5"
2
+ VERSION = "2.3.6"
3
3
  end
@@ -4,8 +4,8 @@ class PasswordResetsController < ApplicationController
4
4
  before_action :set_<%= singular_table_name %>, only: :update
5
5
 
6
6
  def create
7
- if <%= singular_table_name %> = <%= class_name %>.find_by(email: params[:email], verified: true)
8
- IdentityMailer.with(<%= singular_table_name %>: <%= singular_table_name %>).password_reset_provision.deliver_later
7
+ if @<%= singular_table_name %> = <%= class_name %>.find_by(email: params[:email], verified: true)
8
+ IdentityMailer.with(<%= singular_table_name %>: @<%= singular_table_name %>).password_reset_provision.deliver_later
9
9
  else
10
10
  render json: { error: "You can't reset your password until you verify your email" }, status: :not_found
11
11
  end
@@ -2,12 +2,12 @@ class RegistrationsController < ApplicationController
2
2
  skip_before_action :authenticate, only: :create
3
3
 
4
4
  def create
5
- <%= singular_table_name %> = <%= class_name %>.new(<%= "#{singular_table_name}_params" %>)
5
+ @<%= singular_table_name %> = <%= class_name %>.new(<%= "#{singular_table_name}_params" %>)
6
6
 
7
- if <%= singular_table_name %>.save
8
- render json: <%= singular_table_name %>, status: :created
7
+ if @<%= singular_table_name %>.save
8
+ render json: @<%= singular_table_name %>, status: :created
9
9
  else
10
- render json: <%= singular_table_name %>.errors, status: :unprocessable_entity
10
+ render json: @<%= singular_table_name %>.errors, status: :unprocessable_entity
11
11
  end
12
12
  end
13
13
 
@@ -15,10 +15,10 @@ class SessionsController < ApplicationController
15
15
  <%= singular_table_name %> = <%= class_name %>.find_by_email(params[:email])
16
16
 
17
17
  if <%= singular_table_name %> && <%= singular_table_name %>.authenticate(params[:password])
18
- session = <%= singular_table_name %>.sessions.create!(session_params)
19
- response.set_header("X-Session-Token", session.signed_id)
18
+ @session = <%= singular_table_name %>.sessions.create!(session_params)
19
+ response.set_header("X-Session-Token", @session.signed_id)
20
20
 
21
- render json: session, status: :created
21
+ render json: @session, status: :created
22
22
  else
23
23
  render json: { error: "That email or password is incorrect" }, status: :unauthorized
24
24
  end
@@ -10,8 +10,8 @@ class PasswordResetsController < ApplicationController
10
10
  end
11
11
 
12
12
  def create
13
- if <%= singular_table_name %> = <%= class_name %>.find_by(email: params[:email], verified: true)
14
- IdentityMailer.with(<%= singular_table_name %>: <%= singular_table_name %>).password_reset_provision.deliver_later
13
+ if @<%= singular_table_name %> = <%= class_name %>.find_by(email: params[:email], verified: true)
14
+ IdentityMailer.with(<%= singular_table_name %>: @<%= singular_table_name %>).password_reset_provision.deliver_later
15
15
  redirect_to sign_in_path, notice: "Check your email for reset instructions"
16
16
  else
17
17
  redirect_to new_password_reset_path, alert: "You can't reset your password until you verify your email"
@@ -6,10 +6,10 @@ class RegistrationsController < ApplicationController
6
6
  end
7
7
 
8
8
  def create
9
- <%= singular_table_name %> = <%= class_name %>.new(<%= "#{singular_table_name}_params" %>)
9
+ @<%= singular_table_name %> = <%= class_name %>.new(<%= "#{singular_table_name}_params" %>)
10
10
 
11
- if <%= singular_table_name %>.save
12
- session = <%= singular_table_name %>.sessions.create!(session_params)
11
+ if @<%= singular_table_name %>.save
12
+ session = @<%= singular_table_name %>.sessions.create!(session_params)
13
13
  cookies.signed.permanent[:session_token] = { value: session.id, httponly: true }
14
14
 
15
15
  redirect_to root_path, notice: "Welcome! You have signed up successfully"
@@ -15,8 +15,8 @@ class SessionsController < ApplicationController
15
15
  <%= singular_table_name %> = <%= class_name %>.find_by_email(params[:email])
16
16
 
17
17
  if <%= singular_table_name %> && <%= singular_table_name %>.authenticate(params[:password])
18
- session = <%= singular_table_name %>.sessions.create!(session_params)
19
- cookies.signed.permanent[:session_token] = { value: session.id, httponly: true }
18
+ @session = <%= singular_table_name %>.sessions.create!(session_params)
19
+ cookies.signed.permanent[:session_token] = { value: @session.id, httponly: true }
20
20
 
21
21
  redirect_to root_path, notice: "Signed in successfully"
22
22
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ version: 2.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon