phcdevworks_accounts_auth0 0.4.0 → 0.7.0

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: 51eaf99cbd2e95edbe3e8189cdc3bc34eb48f91c8fa7eaa136b3291740bdbe87
4
- data.tar.gz: a3ca5c8b66441909e75786896f98a77f6a788925fde242a5001f43475235b89c
3
+ metadata.gz: df93af515a4dd9baede0c6dc6aadaacd6dc9a15d56549cc83fb5faff52099277
4
+ data.tar.gz: a844b48571fd4e31bf53f017fbc659971315900f5e6db4ec10ebe21e8f745857
5
5
  SHA512:
6
- metadata.gz: 351d8761a9b65a288d8dca1c23af0fe7ebb26454b407e5545e1489bbd6c2b29c798be9c8bec0c90f201566fc5866f990b9851031d0205424d830e07a899add5c
7
- data.tar.gz: 90f6c9535d99450db1d7ac6d5d59a6945b217840612fe2d519a240596ec3bc731c314e07c1ebf4162b416c5ab728419c00767a59f4ea73a29e77a17fb8cf049b
6
+ metadata.gz: e88cff2b6b2ffd8af33c175870fd47ea92e3f1fc8b64081069e9d8f8f36e928be508d1886ed536365e13aadf323f638f59904df868a35f845a63d7613e61ef94
7
+ data.tar.gz: 643aaf0ea4077e228028e98ff5eacad5305a24c67d7a0aa075ec1c1096e3f382bc3e6b308ff957f68ca12c43e8084f41c240c738dda4d8283edd6725207cc059
@@ -25,7 +25,6 @@ module PhcdevworksAccountsAuth0
25
25
  returnTo: root_url,
26
26
  client_id: AUTH0_CONFIG['auth0_client_id']
27
27
  }
28
-
29
28
  URI::HTTPS.build(host: AUTH0_CONFIG['auth0_domain'], path: '/v2/logout', query: to_query(request_params)).to_s
30
29
  end
31
30
 
@@ -1,4 +1,12 @@
1
1
  module PhcdevworksAccountsAuth0
2
2
  class User::PagesController < ApplicationController
3
+
4
+ def dashboard
5
+ end
6
+
7
+ def profile
8
+ @user = session[:userinfo]
9
+ end
10
+
3
11
  end
4
12
  end
@@ -19,9 +19,9 @@
19
19
  <div class="navbar-nav">
20
20
  <div class="navbar-item navbar-user dropdown">
21
21
  <a href="#" class="navbar-link dropdown-toggle d-flex align-items-center" data-bs-toggle="dropdown">
22
- <%= image_tag current_user.gravatar_url %>
22
+ <%= image_tag current_user['picture'] %>
23
23
  <span>
24
- <span class="d-none d-md-inline"><%= current_user.firstname + " " + current_user.lastname %></span>
24
+ <span class="d-none d-md-inline"><%= current_user['name'] %></span>
25
25
  <b class="caret"></b>
26
26
  </span>
27
27
  </a>
@@ -12,7 +12,7 @@
12
12
  <%= image_tag current_user.gravatar_url %>
13
13
  <% end %>
14
14
  <% if defined?phcdevworks_accounts_auth0 %>
15
-
15
+ <%= image_tag current_user['picture'] %>
16
16
  <% end %>
17
17
  </div>
18
18
  <div class="menu-profile-info">
@@ -22,12 +22,19 @@
22
22
  <%= current_user.firstname + " " + current_user.lastname %>
23
23
  <% end %>
24
24
  <% if defined?phcdevworks_accounts_auth0 %>
25
- <%= current_user.name %>
25
+ <%= current_user['name'] %>
26
26
  <% end %>
27
27
  </div>
28
28
  <div class="menu-caret ms-auto"></div>
29
29
  </div>
30
- <small><%= current_user.username %></small>
30
+ <small>
31
+ <% if defined?phcdevworks_accounts_devise %>
32
+ <%= current_user.username %>
33
+ <% end %>
34
+ <% if defined?phcdevworks_accounts_auth0 %>
35
+ <%= current_user['nickname'] %>
36
+ <% end %>
37
+ </small>
31
38
  </div>
32
39
  </a>
33
40
  <% end %>
@@ -843,7 +850,7 @@
843
850
 
844
851
  <!-- -PHCDEV- Page Container - Sidebar - Navigation - PHCDevworks Accounts -->
845
852
 
846
- <% if defined?phcdevworks_accounts_stripe and current_user.admin? %>
853
+ <% if defined?phcdevworks_accounts_stripe and defined?phcdevworks_accounts_devise and current_user.admin? %>
847
854
  <div class="menu-header">Subscription Administration</div>
848
855
  <div class="menu-item has-sub">
849
856
  <a href="javascript:;" class="menu-link">
@@ -899,7 +906,7 @@
899
906
  </div>
900
907
  </div>
901
908
  <% end %>
902
- <% if current_user and current_user.admin? %>
909
+ <% if defined?phcdevworks_accounts_devise and current_user and current_user.admin? %>
903
910
  <div class="menu-header">Login Administration</div>
904
911
  <div class="menu-item has-sub">
905
912
  <a href="javascript:;" class="menu-link">
@@ -0,0 +1,4 @@
1
+ <div>
2
+ <p>Normalized User Profile:<%= JSON.pretty_generate(@user[:info])%></p>
3
+ <p>Full User Profile:<%= JSON.pretty_generate(@user[:extra][:raw_info])%></p>
4
+ </div>
data/config/routes.rb CHANGED
@@ -1,11 +1,10 @@
1
1
  PhcdevworksAccountsAuth0::Engine.routes.draw do
2
2
 
3
3
  # User Dashboard
4
- match "user", to: "user/pages#dashboard", via: "get"
5
- match "user/profile", to: "user/pages#profile", via: "get"
4
+ get "dashboard" => 'user/pages#dashboard'
5
+ get "profile" => 'user/pages#profile'
6
6
 
7
7
  # Auth Routes
8
- get "/auth/", as: "authentication"
9
8
  get "/auth/callback" => "auth/handler#callback"
10
9
  get "/auth/failure" => "auth/handler#failure"
11
10
  get "/auth/logout" => "auth/handler#logout"
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksAccountsAuth0
2
- VERSION = "0.4.0"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcdevworks_accounts_auth0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PHCDevworks