authentication-zero 2.8.3 → 2.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/authentication_zero/version.rb +1 -1
- data/lib/generators/authentication/authentication_generator.rb +0 -1
- data/lib/generators/authentication/templates/controllers/html/sessions/sudos_controller.rb.tt +1 -1
- data/lib/generators/authentication/templates/erb/sessions/new.html.erb.tt +1 -1
- data/lib/generators/authentication/templates/migrations/create_table_migration.rb.tt +7 -0
- metadata +2 -3
- data/lib/generators/authentication/templates/migrations/add_omniauth_migration.rb.tt +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfa3da3a6167d405cd7869b9cb90f7c61eee5ef1d03475d079d72362a3bedf04
|
4
|
+
data.tar.gz: 3775ac3bd3fb334134618c9cbc8b32c25a5a3940246a554592e74415383de72b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b596006ad41a57e3c3e54d21393ae2ceae9b21b36a11666f0988b2d59bda944c499d599074ced369cedbdb5cde98fc831f97691a3274d3467596904a7f2022c
|
7
|
+
data.tar.gz: 7096373b36cf3c9dead056e3d0584f4e44eb97b6efa353e0b3a7f9399620eb59aa3c298e5016aef38138508c9e01d4d1c1e99d4918730e6f9d3eda0b8e035a6a
|
data/Gemfile.lock
CHANGED
@@ -47,7 +47,6 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
|
|
47
47
|
def create_migrations
|
48
48
|
migration_template "migrations/create_table_migration.rb", "#{db_migrate_path}/create_#{table_name}.rb"
|
49
49
|
migration_template "migrations/create_sessions_migration.rb", "#{db_migrate_path}/create_sessions.rb"
|
50
|
-
migration_template "migrations/add_omniauth_migration.rb", "#{db_migrate_path}/add_omniauth_to_#{table_name}.rb" if omniauthable?
|
51
50
|
end
|
52
51
|
|
53
52
|
def create_models
|
data/lib/generators/authentication/templates/controllers/html/sessions/sudos_controller.rb.tt
CHANGED
@@ -5,7 +5,7 @@ class Sessions::SudosController < ApplicationController
|
|
5
5
|
def create
|
6
6
|
session = Current.session
|
7
7
|
|
8
|
-
<% if
|
8
|
+
<% if omniauthable? -%>
|
9
9
|
if session.<%= singular_table_name %>.authenticate(params[:password]) || session.<%= singular_table_name %>.provider
|
10
10
|
<% else -%>
|
11
11
|
if session.<%= singular_table_name %>.authenticate(params[:password])
|
@@ -5,10 +5,17 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
|
|
5
5
|
t.string :password_digest, null: false
|
6
6
|
|
7
7
|
t.boolean :verified, null: false, default: false
|
8
|
+
<% if omniauthable? %>
|
9
|
+
t.string :provide
|
10
|
+
t.string :uid
|
11
|
+
<% end -%>
|
8
12
|
|
9
13
|
t.timestamps
|
10
14
|
end
|
11
15
|
|
12
16
|
add_index :<%= table_name %>, :email, unique: true
|
17
|
+
<% if omniauthable? -%>
|
18
|
+
add_index :<%= table_name %>, [:provider, :uid], unique: true
|
19
|
+
<% end -%>
|
13
20
|
end
|
14
21
|
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.8.
|
4
|
+
version: 2.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nixon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -65,7 +65,6 @@ files:
|
|
65
65
|
- lib/generators/authentication/templates/erb/sessions/sudos/new.html.erb.tt
|
66
66
|
- lib/generators/authentication/templates/mailers/identity_mailer.rb.tt
|
67
67
|
- lib/generators/authentication/templates/mailers/session_mailer.rb.tt
|
68
|
-
- lib/generators/authentication/templates/migrations/add_omniauth_migration.rb.tt
|
69
68
|
- lib/generators/authentication/templates/migrations/create_sessions_migration.rb.tt
|
70
69
|
- lib/generators/authentication/templates/migrations/create_table_migration.rb.tt
|
71
70
|
- lib/generators/authentication/templates/models/current.rb.tt
|
@@ -1,8 +0,0 @@
|
|
1
|
-
class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
2
|
-
def change
|
3
|
-
add_column :<%= table_name %>, :provider, :string
|
4
|
-
add_column :<%= table_name %>, :uid, :string
|
5
|
-
end
|
6
|
-
|
7
|
-
add_index :<%= table_name %>, [:provider, :uid], unique: true
|
8
|
-
end
|