mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
Add missing login-mode file
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import Alpine from '@alpinejs/csp';
|
||||
|
||||
Alpine.data('loginMode', () => ({
|
||||
supported: false,
|
||||
showPassword: false,
|
||||
|
||||
init() {
|
||||
this.supported = typeof window.browserSupportsWebAuthn === 'function'
|
||||
&& window.browserSupportsWebAuthn();
|
||||
|
||||
const prefersPassword = this.$el.dataset.prefersPassword === '1';
|
||||
if (! this.supported || prefersPassword) {
|
||||
this.showPassword = true;
|
||||
}
|
||||
},
|
||||
|
||||
usePassword() {
|
||||
this.showPassword = true;
|
||||
},
|
||||
|
||||
usePasskey() {
|
||||
this.showPassword = false;
|
||||
},
|
||||
}));
|
||||
Reference in New Issue
Block a user