File tree Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Original file line number Diff line number Diff line change 15
15
16
16
if ($ params ->get ('show-login-form ' ) == 1 ) {
17
17
18
+ $ redirectUrl = $ params ->get ('redirect-url ' );
18
19
$ showAsModal = ($ params ->get ('show-as-modal ' ) == 1 );
19
20
$ bigSocialButtons = ($ params ->get ('big-social-button ' ) == 1 );
20
21
$ lockURL = $ params ->get ('lock-url ' );
55
56
$ lockOptions ['dict ' ] = $ dict ;
56
57
}
57
58
59
+ if (!empty ($ redirectUrl )) {
60
+ $ lockOptions ['authParams ' ]['state ' ] = base64_encode ($ redirectUrl );
61
+ }
62
+
58
63
if (!empty ($ iconURL )) {
59
64
$ lockOptions ['icon ' ] = $ iconURL ;
60
65
}
67
72
$ lockOptionsJson = json_encode ($ lockOptions );
68
73
69
74
$ javascript = "
70
- var lock;
71
- jQuery( document ).ready(function(){
72
- lock = new Auth0Lock('$ clientid', ' $ domain');
73
- });
75
+ var lock;
76
+ jQuery( document ).ready(function(){
77
+ lock = new Auth0Lock('$ clientid', ' $ domain');
78
+ });
74
79
75
- function a0ShowLock() {
76
- lock.show($ lockOptionsJson);
77
- }
80
+ function a0ShowLock() {
81
+ lock.show($ lockOptionsJson);
82
+ }
78
83
79
- " ;
84
+ " ;
80
85
81
86
$ auth0js = '<script src=" ' . $ lockURL . '"></script> ' ;
82
87
@@ -86,11 +91,11 @@ function a0ShowLock() {
86
91
} else {
87
92
$ javascript .= "
88
93
89
- jQuery( document ).ready(function(){
90
- a0ShowLock();
91
- });
94
+ jQuery( document ).ready(function(){
95
+ a0ShowLock();
96
+ });
92
97
93
- " ;
98
+ " ;
94
99
echo '<div id="auth0-login-form"></div> ' ;
95
100
}
96
101
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ function display($cachable = false, $urlparams = false)
31
31
}
32
32
33
33
private function getReturn ($ key , $ type ) {
34
- $ return = base64_decode ($ this ->app ->input ->post ->get ($ key , '' , $ type ));
34
+ $ return = base64_decode ($ this ->app ->input ->get ->get ($ key , '' , $ type ));
35
35
if (!JUri::isInternal ($ return ))
36
36
{
37
37
$ return = '' ;
@@ -67,7 +67,7 @@ function AuthJUser()
67
67
68
68
if (empty ($ return ))
69
69
{
70
- $ return = $ mod_params -> get ( ' redirect-url ' , ' index.php?option=com_users&view=profile ') ;
70
+ $ return = ' index.php?option=com_users&view=profile ' ;
71
71
}
72
72
73
73
// Set the return URL in the user state to allow modification by plugins
You can’t perform that action at this time.
0 commit comments