Microsoft Edge (Pre-Chromium) Support
Note: These steps are only required if you need to support pre-Chromium Edge browsers. If you are creating a pure hybrid-native app or otherwise have no reason to support pre-Chromium Edge, then you can override methods like isAuthenticated()
in the usual manner.
Due to a bug in the pre-Chromium version of Edge, you cannot overide a method in a subclass.
For instance, it is common to create a class that extends IonicAuth
like this:
export class AuthenticationService extends IonicAuth {
private vaultService: VaultService;
...
async isAuthenticated(): Promise<boolean> {
const isVaultLocked = await this.vaultService.isLocked();
return !isVaultLocked && (await super.isAuthenticated());
}
...
}
If you need to support the pre-Chromium version of Edge, you will need to write your own method in the subclass that calls into the base class as follows:
export class AuthenticationService extends IonicAuth {
private vaultService: VaultService;
...
async myAppIsAuthenticated(): Promise<boolean> {
const isVaultLocked = await this.vaultService.isLocked();
return !isVaultLocked && (await super.isAuthenticated());
}
...
}
You will then need to change external references from this.authentication.isAuthenticated()
to this.authentication.myAppIsAuthenticated()
(the name is not important so much as the fact that you are not overriding the base class method, pick a name that makes sense to you).
You will also need to use the CURRENT
behavior for implicitLogin
on Edge.