ffcrm_google_oauth2 0.0.1 → 0.0.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef68d609c13ffce8f1003588f6951161da4d730a
|
4
|
+
data.tar.gz: c146202a8cc38aabc2c201f4f379ad8ca34c284e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a5ebb869efb815701129adc8039d70e22f15de4bb1e141f8cfc39890e294699f908eaeff379e32171a9cbf72aabac4e05fddae82e5dfb7fedbf541891bf8368
|
7
|
+
data.tar.gz: 1075f09223885aae5202cd19f28bdf6e1938d553851bd21b7890b47c48c471cd619ae43d5178355551c801a2427621844d2593c5e9f4efda0321553f177ddb71
|
@@ -1,21 +1,24 @@
|
|
1
1
|
.standalone#standalone
|
2
2
|
-# The following form gets submitted to #create when @authentication is nil,
|
3
3
|
-# or to #update when @authentication is not nil (ex. suspended).
|
4
|
+
|
4
5
|
= form_for @authentication, :url => authentication_path, :html => one_submit_only do |f|
|
5
|
-
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
.
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
- unless Setting.oauth_only
|
7
|
+
- if can_signup?
|
8
|
+
.title_tools #{t :no_account} #{link_to t(:sign_up_now), signup_path}
|
9
|
+
.title= t(:login)
|
10
|
+
.section
|
11
|
+
.label= t(:username) + ':'
|
12
|
+
= f.text_field :username
|
13
|
+
.label= t(:password) + ':'
|
14
|
+
= f.password_field :password
|
15
|
+
|
16
|
+
%div(style="margin-left:12px") #{f.check_box(:remember_me)} #{t :remember_me}
|
17
|
+
%br
|
18
|
+
.buttonbar
|
19
|
+
= f.submit t(:login)
|
20
|
+
#{t :or}
|
21
|
+
= link_to t(:forgot_password) << '?', new_password_path
|
13
22
|
|
14
|
-
%div(
|
15
|
-
%br
|
16
|
-
.buttonbar
|
17
|
-
= f.submit t(:login)
|
18
|
-
#{t :or}
|
19
|
-
= link_to t(:forgot_password) << '?', new_password_path
|
20
|
-
%div(style="margin:24px 12px 0 12px;text-align: center;")
|
23
|
+
%div{:style => (Setting.oauth_only ? "margin:4px 12px 0 12px;text-align: center;" : "margin:24px 12px 0 12px;text-align: center;" )}
|
21
24
|
= link_to (image_tag("google-signin-button.png",style: "width:246px;background-color: transparent;")), "/auth/google_oauth2/", style: "background-color:transparent! important;"
|
@@ -2,7 +2,7 @@ AuthenticationsController.class_eval do
|
|
2
2
|
def callback
|
3
3
|
auth_hash = request.env["omniauth.auth"]
|
4
4
|
email = auth_hash[:info][:email]
|
5
|
-
user = User.where(
|
5
|
+
user = User.where(User.arel_table[:email].matches(email)).first
|
6
6
|
if user
|
7
7
|
unless user.suspended?
|
8
8
|
Authentication.create(user,true) # true - remember me
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffcrm_google_oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DmitriySalko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fat_free_crm
|