UNPKG

@axa-fr/oidc-client

Version:

OpenID Connect & OAuth authentication using native javascript only, compatible with angular, react, vue, svelte, next, etc.

31 lines (25 loc) 570 B
export interface ILOidcLocation { open(url: string): void; reload(): void; getCurrentHref(): string; getPath(): string; getOrigin(): string; } export class OidcLocation implements ILOidcLocation { open(url: string) { window.location.href = url; } reload() { window.location.reload(); } getCurrentHref() { return window.location.href; } getPath() { const location = window.location; return location.pathname + (location.search || '') + (location.hash || ''); } getOrigin(): string { return window.origin; } }