phcdevworks_accounts_auth0 1.1.3b → 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: c4d02a0db088c84a0f5ff1a34eb3cccad0b8cf98d72282529914bef8af11e548
4
- data.tar.gz: d373c81784bc3c043862928d45e4b99abe594c0f1689803e9111ecc3617a524a
3
+ metadata.gz: 1fc14fb563076fee0a16e7c6a3d8244da06627d0920686eb4d02b3a94af5eb09
4
+ data.tar.gz: fd6db32697b2884d145c466edecb995990787bff9fc2fbbf9773723713657ec0
5
5
  SHA512:
6
- metadata.gz: 5792fb8c3d4b7259001069d53559cd994cf35f3992980c42468081cb20b6e6ea8270f5653dde2de64265255906fa59aa9d62a25c67372b9cb830a9ec5be3319d
7
- data.tar.gz: cae196c237172aca896e3e77e4123aeeff073824a9ff4c0337e591574f5a06e41e22ca3347ea1b779ee3383c19b3db82dc443ad967636623a327b43292a723d4
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
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksAccountsAuth0
2
- VERSION = "1.1.3b"
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.3b
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