Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was 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

@chigivigi

Description

@chigivigi

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions