web/elements: fix copy on insecure origins (#4917)
* web/elements: fix copy on insecure origins Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fallback to messages for other clipboard uses Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -82,6 +82,13 @@ export class AuthenticatorTOTPStage extends BaseStage<
|
||||
@click=${(e: Event) => {
|
||||
e.preventDefault();
|
||||
if (!this.challenge?.configUrl) return;
|
||||
if (!navigator.clipboard) {
|
||||
showMessage({
|
||||
level: MessageLevel.info,
|
||||
message: this.challenge?.configUrl,
|
||||
});
|
||||
return;
|
||||
}
|
||||
navigator.clipboard
|
||||
.writeText(this.challenge?.configUrl)
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user