tramway-auth 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 296edc29aec74f9944ac494dc9fd393384f1d060bc4110aede56e023a22ec8cc
|
4
|
+
data.tar.gz: 65612c69a4d28844ef172a4c113c7d97bea422b4eceda2951876238f6c81d43b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d2389875a90181944620b3188e6e2174e20933796007fc8b267b2d8ffbc7a7c11c4d7f207a973e525e470d7a58c20584602f05419c828f5c01dcc1ca5bde5dc
|
7
|
+
data.tar.gz: cfe0f77f8e1a049b1d9d1750d8d5cad9e64ba1f02dcc56ff5f56a506783bb337bce88cafa00faa7d816ff8b2ec3efd5b39baf2cfdfe4a30c85b8c695dfbb7135
|
@@ -7,11 +7,15 @@ module Tramway::Auth
|
|
7
7
|
|
8
8
|
def create
|
9
9
|
@session_form = ::Tramway::Auth::SessionForm.new params[:model].constantize.active.find_by email: params[:user][:email]
|
10
|
-
if @session_form.
|
11
|
-
|
12
|
-
|
10
|
+
if @session_form.model.present?
|
11
|
+
if @session_form.validate params[:user]
|
12
|
+
sign_in @session_form.model
|
13
|
+
redirect_to [params[:success_redirect], '?', { flash: :success_user_sign_in }.to_query].join || ::Tramway::Auth.root_path_for(@session_form.model.class)
|
14
|
+
else
|
15
|
+
redirect_to [params[:error_redirect], '?', { flash: :error_user_sign_in }.to_query].join || ::Tramway::Auth.root_path_for(@session_form.model.class)
|
16
|
+
end
|
13
17
|
else
|
14
|
-
redirect_to [params[:error_redirect], '?', { flash: :error_user_sign_in }.to_query].join || ::Tramway::Auth.root_path_for(
|
18
|
+
redirect_to [params[:error_redirect], '?', { flash: :error_user_sign_in }.to_query].join || ::Tramway::Auth.root_path_for(params[:model].constantize)
|
15
19
|
end
|
16
20
|
end
|
17
21
|
|
@@ -24,7 +28,9 @@ module Tramway::Auth
|
|
24
28
|
private
|
25
29
|
|
26
30
|
def redirect_if_signed_in
|
27
|
-
|
31
|
+
if params[:model].present? && signed_in?(params[:model].constantize) && request.env['PATH_INFO'] != ::Tramway::Auth.root_path_for(current_user.class)
|
32
|
+
redirect_to ::Tramway::Auth.root_path_for(current_user.class)
|
33
|
+
end
|
28
34
|
end
|
29
35
|
end
|
30
36
|
end
|
data/lib/tramway/auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails engine for auth
|
14
14
|
email:
|