@@ -114,7 +114,7 @@ export class AppComponent implements OnInit, OnDestroy {
114114 const refreshToken = this . authRepository . getRefreshTokenValue ( ) ;
115115 if ( refreshToken ) {
116116 const refreshTokenValue = AuthService . decodeToken ( refreshToken ) ;
117- const isRefreshTokenExpired = Date . now ( ) >= ( refreshTokenValue ?. exp || 0 ) * 1000 ;
117+ const isRefreshTokenExpired = Date . now ( ) >= ( refreshTokenValue ?. exp ?? 0 ) * 1000 ;
118118 if ( isRefreshTokenExpired && ! event . url . includes ( authRoutes . logout ) ) {
119119 this . router . navigate ( [ authRoutes . logout ] , {
120120 queryParams : {
@@ -152,9 +152,9 @@ export class AppComponent implements OnInit, OnDestroy {
152152
153153 if ( accessToken && refreshToken ) {
154154 const accessTokenValue = AuthService . decodeToken ( accessToken ) ;
155- const isAccessTokenExpired = Date . now ( ) >= ( accessTokenValue ?. exp || 0 ) * 1000 ;
155+ const isAccessTokenExpired = Date . now ( ) >= ( accessTokenValue ?. exp ?? 0 ) * 1000 ;
156156 const refreshTokenValue = AuthService . decodeToken ( refreshToken ) ;
157- const isRefreshTokenExpired = Date . now ( ) >= ( refreshTokenValue ?. exp || 0 ) * 1000 ;
157+ const isRefreshTokenExpired = Date . now ( ) >= ( refreshTokenValue ?. exp ?? 0 ) * 1000 ;
158158 if ( isAccessTokenExpired ) {
159159 if ( ! isRefreshTokenExpired ) {
160160 this . authService
@@ -163,7 +163,7 @@ export class AppComponent implements OnInit, OnDestroy {
163163 takeUntil ( this . destroy$ ) ,
164164 catchError ( ( error ) : ObservableInput < HttpEvent < unknown > > => {
165165 this . navigateToLogout ( ) ;
166- return observableThrowError ( error ) ;
166+ throw new Error ( error ) ;
167167 } ) ,
168168 )
169169 . subscribe ( ) ;
0 commit comments