File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -168,12 +168,26 @@ export class OAuthService extends AuthConfig {
168
168
this . restartRefreshTimerIfStillLoggedIn ( ) ;
169
169
}
170
170
171
+ /**
172
+ * Convenience method that first calls `loadDiscoveryDocument(...)` and
173
+ * directly chains using the `then(...)` part of the promise to call
174
+ * the `tryLogin(...)` method.
175
+ *
176
+ * @param options LoginOptions to pass through to `tryLogin(...)`
177
+ */
171
178
public loadDiscoveryDocumentAndTryLogin ( options : LoginOptions = null ) {
172
179
return this . loadDiscoveryDocument ( ) . then ( doc => {
173
180
return this . tryLogin ( options ) ;
174
181
} ) ;
175
182
}
176
183
184
+ /**
185
+ * Convenience method that first calls `loadDiscoveryDocumentAndTryLogin(...)`
186
+ * and if then chains to `initImplicitFlow()`, but only if there is no valid
187
+ * IdToken or no valid AccessToken.
188
+ *
189
+ * @param options LoginOptions to pass through to `tryLogin(...)`
190
+ */
177
191
public loadDiscoveryDocumentAndLogin ( options : LoginOptions = null ) {
178
192
return this . loadDiscoveryDocumentAndTryLogin ( options ) . then ( _ => {
179
193
if ( ! this . hasValidIdToken ( ) || ! this . hasValidAccessToken ( ) ) {
You can’t perform that action at this time.
0 commit comments