File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/Server/Coderr.Server.WebSite/ClientApp/src Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export class AuthorizeGuard implements CanActivate {
2121
2222 var loginUrl = localStorage . getItem ( 'loginUrl' ) ;
2323 if ( loginUrl ) {
24- window . location = loginUrl ;
24+ window . location . href = loginUrl ;
2525 return false ;
2626 }
2727
Original file line number Diff line number Diff line change 11import { Injectable } from '@angular/core' ;
22import { Router } from '@angular/router' ;
3+ declare var window : any ;
34
45export interface IRequestOptions {
56 method ?: "GET" | "POST" | "PUT" | "DELETE" ,
@@ -68,6 +69,14 @@ export class ApiClient {
6869 var json = JSON . stringify ( query ) ;
6970 var response = await this . http . post ( `${ this . cqsUrl } ?type=${ query . constructor . TYPE_NAME } ` , json , { headers : headers } ) ;
7071 if ( response . statusCode === 401 ) {
72+
73+ // to support Cloud logins.
74+ let url = localStorage . getItem ( 'loginUrl' ) ;
75+ if ( url && url != '/account/login' ) {
76+ window . location . href = url ;
77+ return null ;
78+ }
79+
7180 this . router . navigate ( [ 'account/login' ] , { queryParams : { returnUrl : window . location . pathname + window . location . search } } ) ;
7281 throw new HttpError ( response ) ;
7382 }
You can’t perform that action at this time.
0 commit comments