Skip to content

Commit 5975b5c

Browse files
Ensure logout returns an observable instead of a promise
1 parent d72604d commit 5975b5c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

projects/auth0-angular/src/lib/auth.service.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,14 @@ export class AuthService<TAppState extends AppState = AppState>
183183
*
184184
* @param options The logout options
185185
*/
186-
async logout(options?: LogoutOptions): Promise<void> {
187-
await this.auth0Client.logout(options);
188-
189-
if (options?.onRedirect) {
190-
this.authState.refresh();
191-
}
186+
logout(options?: LogoutOptions): Observable<void> {
187+
return from(
188+
this.auth0Client.logout(options).then(() => {
189+
if (options?.onRedirect) {
190+
this.authState.refresh();
191+
}
192+
})
193+
);
192194
}
193195

194196
/**

0 commit comments

Comments
 (0)