phcdevworks_accounts_auth0 1.1.2b → 1.1.4b

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: 1eb5fc3ab1f06ad9ad83af29c76525ea875cf90d522a3e74fa511263961cbf5c
4
- data.tar.gz: 7c57b1645d8d524419d070d03deb808dc2f8844e36e7ca9402c635644ea3d9b0
3
+ metadata.gz: 1fc14fb563076fee0a16e7c6a3d8244da06627d0920686eb4d02b3a94af5eb09
4
+ data.tar.gz: fd6db32697b2884d145c466edecb995990787bff9fc2fbbf9773723713657ec0
5
5
  SHA512:
6
- metadata.gz: 07daf15993d38dd7b3b3760de0fce434c82b274c56ebcd6dc8b70ec653f7e6f7ae81ee3d35f02981002c6740628634976b774ccc384a7d907210d407a5fbf3fe
7
- data.tar.gz: d95890cd20e3a4429bfd7df9a6b8621b2b541bd210dd890f397f4af1baaf2dbae62538c905182c0ac9d6fbc0b475dc5dcd3672144d53eabeeb22fd392d1a2fb9
6
+ metadata.gz: 99d27d09c5427b769a465f4c855a66b24bf629c6b56dbac4d489a9a9644e326c17427b866cde705e7fd84799576a62349bcc301a912fd37d8818a0fb8493c25c
7
+ data.tar.gz: 4a0f6828d97e6c9a918afa4194fa8a3b78df3be28de97f398219dd5e96a68a990112eda534f4be4234c3dcf7bcfe0c1e228d5d4e433aca0a88f2f3c07a5a4f4d
@@ -1,14 +1,13 @@
1
- module PhcdevworksAccountsAuth0
1
+ module PhcdevworksAccountsAuth0
2
2
  class Auth::HandlerController < ApplicationController
3
3
 
4
4
  def callback
5
- auth_info = request.env["omniauth.auth"]
6
- session[:userinfo] = auth_info["extra"]["raw_info"]
5
+ session[:userinfo] = request.env['omniauth.auth']['extra']['raw_info']
7
6
  redirect_to main_app.root_path
8
7
  end
9
8
 
10
9
  def failure
11
- @error_msg = request.params["message"]
10
+ @error_msg = request.params['message']
12
11
  end
13
12
 
14
13
  def logout
@@ -18,14 +17,14 @@ module PhcdevworksAccountsAuth0
18
17
 
19
18
  private
20
19
 
21
- AUTH0_CONFIG = Rails.application.config_for(:auth0)
20
+ AUTH0_CONFIG = Rails.application.config.auth0
22
21
 
23
22
  def logout_url
24
23
  request_params = {
25
- returnTo: main_app.root_url,
26
- client_id: AUTH0_CONFIG['auth0_client_id']
24
+ returnTo: root_url,
25
+ client_id: Rails.application.config.auth0['auth0_client_id']
27
26
  }
28
- URI::HTTPS.build(host: AUTH0_CONFIG["auth0_domain"], path: "/v2/logout", query: to_query(request_params)).to_s
27
+ URI::HTTPS.build(host: AUTH0_CONFIG['auth0_domain'], path: '/v2/logout', query: request_params.to_query).to_s
29
28
  end
30
29
 
31
30
  def to_query(hash)
@@ -1,29 +1,29 @@
1
1
  module PhcdevworksAccountsAuth0
2
- module ApplicationHelper
2
+ module ApplicationHelper
3
3
 
4
- def user_signed_in?
5
- session['userinfo'].present?
6
- end
4
+ def user_signed_in?
5
+ session['userinfo'].present?
6
+ end
7
7
 
8
- def authenticate_user!
9
- if user_signed_in?
10
- @current_user = session['userinfo']
11
- else
12
- redirect_to root_path
13
- end
14
- end
8
+ def authenticate_user!
9
+ if user_signed_in?
10
+ @current_user = session['userinfo']
11
+ else
12
+ redirect_to root_path
13
+ end
14
+ end
15
15
 
16
- def current_user
17
- @current_user
18
- end
16
+ def current_user
17
+ @current_user
18
+ end
19
19
 
20
- def reset_session
21
- session['userinfo'] = nil if session['userinfo'].present?
22
- end
20
+ def reset_session
21
+ session['userinfo'] = nil if session['userinfo'].present?
22
+ end
23
23
 
24
- def current_user
25
- @current_user = session['userinfo']
26
- end
24
+ def current_user
25
+ @current_user = session['userinfo']
26
+ end
27
27
 
28
- end
28
+ end
29
29
  end
@@ -1 +1,4 @@
1
- <h1>You Are Logged Out</h1>
1
+ <div class="panel panel-danger">
2
+ <h2>Error <%= @error_msg %></h2>
3
+ <p><%= @omniauth_error %></p>
4
+ </div>
@@ -1,14 +1,14 @@
1
- AUTH0_CONFIG = Rails.application.config_for(:auth0)
1
+ Rails.application.config.auth0 = Rails.application.config_for(:auth0)
2
2
 
3
3
  Rails.application.config.middleware.use OmniAuth::Builder do
4
4
  provider(
5
5
  :auth0,
6
- AUTH0_CONFIG['auth0_client_id'],
7
- AUTH0_CONFIG['auth0_client_secret'],
8
- AUTH0_CONFIG['auth0_domain'],
6
+ Rails.application.config.auth0['auth0_client_id'],
7
+ Rails.application.config.auth0['auth0_client_secret'],
8
+ Rails.application.config.auth0['auth0_domain'],
9
9
  callback_path: '/auth/callback',
10
10
  authorize_params: {
11
- scope: 'openid profile'
11
+ scope: 'openid profile email'
12
12
  }
13
13
  )
14
14
  end
@@ -3,7 +3,6 @@ module PhcdevworksAccountsAuth0
3
3
 
4
4
  # PHCDEVONE - Add Requried Dependencies
5
5
  require "omniauth-auth0"
6
- require "omniauth-rails_csrf_protection"
7
6
 
8
7
  # PHCDEVONE - Isolate Engine
9
8
  isolate_namespace PhcdevworksAccountsAuth0
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksAccountsAuth0
2
- VERSION = "1.1.2b"
2
+ VERSION = "1.1.4b"
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: 1.1.2b
4
+ version: 1.1.4b
5
5
  platform: ruby
6
6
  authors:
7
7
  - PHCDevworks
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-28 00:00:00.000000000 Z
12
+ date: 2023-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails