aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/src/main-personal-webauth.js
blob: 4f5397f257c5b28ad7df7afcf65803a8990b09e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
 * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

import Vue from 'vue'
import { loadState } from '@nextcloud/initial-state'

import WebAuthnSection from './components/WebAuthn/Section.vue'

// eslint-disable-next-line camelcase
__webpack_nonce__ = btoa(OC.requestToken)

Vue.prototype.t = t

const View = Vue.extend(WebAuthnSection)
const devices = loadState('settings', 'webauthn-devices')
new View({
	propsData: {
		initialDevices: devices,
		isHttps: window.location.protocol === 'https:',
		isLocalhost: window.location.hostname === 'localhost',
	},
}).$mount('#security-webauthn')