Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Using hash in IE 11 and Microsoft Edge 41 when routing #438

Open
chigivigi opened this issue Mar 12, 2018 · 0 comments
Open

Using hash in IE 11 and Microsoft Edge 41 when routing #438

chigivigi opened this issue Mar 12, 2018 · 0 comments

Comments

@chigivigi
Copy link

chigivigi commented Mar 12, 2018

I made a single page application that uses angular version 5.2.3 and adal authentication. My routing is set to have hash inside it and that works fine when using it in Google Chrome but it does not work in IE and Edge. Once I remove hash from routes configuration, it starts working in IE and Edge but I do not want to use routing without hash. Is there a way to have hash in routes when used in IE and Edge ?

code snippet for setting routes in my controller
const appRoutes: Routes = [
{
path : 'Apps',
loadChildren: './main/content/apps/apps.module#AppsModule'
},
{
path : '**',
redirectTo: 'Apps/Load'
}
];
@NgModule({
imports : [
RouterModule.forRoot(appRoutes, {useHash: true})
]
})

code snippet for setting adal:
package.json: dependencies: "@types/adal": "^1.0.29"

adal.service.ts:
export class AdalService {
private _config: adal.Config;
private _context: adal.AuthenticationContext;
constructor() {
this._config = {
tenant: environment.tenant,
clientId: environment.AppId,
redirectUri: window.location.origin + '/',
postLogoutRedirectUri: window.location.origin + '/',
endpoints: environment.endpoints,
cacheLocation: environment.cacheLocation
};
this._context = new AuthenticationContext(this._config);
}
}

apps page login:
this.adalService.context.login();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant