@@ -7,7 +7,6 @@ import UserManagerSettings from './UserManagerSettings';
77import User from './User' ;
88import UserManagerEvents from './UserManagerEvents' ;
99import SilentRenewService from './SilentRenewService' ;
10- import CordovaSilentRenewService from './CordovaSilentRenewService' ;
1110
1211export default class UserManager extends OidcClient {
1312 constructor ( settings = { } ) {
@@ -23,18 +22,11 @@ export default class UserManager extends OidcClient {
2322 Log . info ( "automaticSilentRenew is configured, setting up silent renew" )
2423 this . _silentRenewService = new SilentRenewService ( this ) ;
2524 }
26- if ( this . settings . automaticCordovaSilentRenew ) {
27- Log . info ( "automaticCordovaSilentRenew is configured, setting up cordova silent renew" )
28- this . _cordovaSilentRenewService = new CordovaSilentRenewService ( this ) ;
29- }
3025 }
3126
3227 get _redirectNavigator ( ) {
3328 return this . settings . redirectNavigator ;
3429 }
35- get _cordovaPopupNavigator ( ) {
36- return this . settings . cordovaPopupNavigator ;
37- }
3830 get _popupNavigator ( ) {
3931 return this . settings . popupNavigator ;
4032 }
@@ -75,60 +67,6 @@ export default class UserManager extends OidcClient {
7567 } ) ;
7668 }
7769
78- signinCordovaPopup ( args = { } ) {
79- Log . info ( "UserManager.signinCordovaPopup" ) ;
80-
81- let url = args . redirect_uri || this . settings . popup_redirect_uri || this . settings . redirect_uri ;
82- if ( ! url ) {
83- Log . error ( "No popup_redirect_uri or redirect_uri configured" ) ;
84- return Promise . reject ( new Error ( "No popup_redirect_uri or redirect_uri configured" ) ) ;
85- }
86-
87- args . redirect_uri = url ;
88- args . display = "popup" ;
89-
90- return this . _signin ( args , this . _cordovaPopupNavigator , {
91- startUrl : url ,
92- popupWindowFeatures : args . popupWindowFeatures || this . settings . popupWindowFeatures ,
93- popupWindowTarget : args . popupWindowTarget || this . settings . popupWindowTarget
94- } ) ;
95- }
96- signoutCordovaPopup ( args = { } ) {
97- Log . info ( "UserManager.signoutCordovaPopup" ) ;
98-
99- let url = args . redirect_uri || this . settings . popup_redirect_uri || this . settings . redirect_uri ;
100- if ( ! url ) {
101- Log . error ( "No popup_redirect_uri or redirect_uri configured" ) ;
102- return Promise . reject ( new Error ( "No popup_redirect_uri or redirect_uri configured" ) ) ;
103- }
104-
105- args . redirect_uri = url ;
106- args . display = "popup" ;
107-
108- return this . _signout ( args , this . _cordovaPopupNavigator , {
109- startUrl : url ,
110- popupWindowFeatures : args . popupWindowFeatures || this . settings . popupWindowFeatures ,
111- popupWindowTarget : args . popupWindowTarget || this . settings . popupWindowTarget
112- } ) ;
113- }
114- signinCordovaSilent ( args = { } ) {
115- Log . info ( "UserManager.signinCordovaSilent" ) ;
116-
117- let url = args . redirect_uri || this . settings . silent_redirect_uri ;
118- if ( ! url ) {
119- Log . error ( "No silent_redirect_uri configured" ) ;
120- return Promise . reject ( new Error ( "No silent_redirect_uri configured" ) ) ;
121- }
122-
123- args . redirect_uri = url ;
124- args . prompt = "none" ;
125-
126- return this . _signin ( args , this . _cordovaPopupNavigator , {
127- startUrl : url ,
128- popupWindowFeatures : 'hidden=yes' ,
129- popupWindowTarget : args . popupWindowTarget || this . settings . popupWindowTarget
130- } ) ;
131- }
13270 signinPopup ( args = { } ) {
13371 Log . info ( "UserManager.signinPopup" ) ;
13472
@@ -163,7 +101,7 @@ export default class UserManager extends OidcClient {
163101 args . redirect_uri = url ;
164102 args . prompt = "none" ;
165103
166- return this . _signin ( args , this . _iframeNavigator ) ;
104+ return this . _signin ( args , this . _iframeNavigator , { startUrl : url } ) ;
167105 }
168106 signinSilentCallback ( url ) {
169107 Log . info ( "UserManager.signinSilentCallback" ) ;
@@ -203,6 +141,21 @@ export default class UserManager extends OidcClient {
203141 Log . info ( "UserManager.signoutRedirect" ) ;
204142 return this . _signoutStart ( args , this . _redirectNavigator ) ;
205143 }
144+ signoutPopup ( args = { } ) {
145+ Log . info ( "UserManager.signoutPopup" ) ;
146+
147+ let url = args . redirect_uri || this . settings . popup_redirect_uri || this . settings . redirect_uri ;
148+ if ( ! url ) {
149+ Log . error ( "No popup_redirect_uri or redirect_uri configured" ) ;
150+ return Promise . reject ( new Error ( "No popup_redirect_uri or redirect_uri configured" ) ) ;
151+ }
152+
153+ return this . _signout ( args , this . _popupNavigator , {
154+ startUrl : url ,
155+ popupWindowFeatures : args . popupWindowFeatures || this . settings . popupWindowFeatures ,
156+ popupWindowTarget : args . popupWindowTarget || this . settings . popupWindowTarget
157+ } ) ;
158+ }
206159 signoutRedirectCallback ( url ) {
207160 Log . info ( "UserManager.signoutRedirectCallback" ) ;
208161 return this . _signoutEnd ( url || this . _redirectNavigator . url ) ;
0 commit comments