Skip to content

Commit

Permalink
Fix JS code-sytle (Lint)
Browse files Browse the repository at this point in the history
Signed-off-by: Olav Seyfarth <olav@seyfarth.de>
  • Loading branch information
nursoda committed Jan 3, 2023
1 parent 36e8590 commit f070464
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/components/L10n.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@

<script>
export default {
props: ['text', 'options'],
props: {
text: {
type: String,
required: true,
},
options: {
type: Object,
default() {
return {}
},
},
},
computed: {
translated() {
return t('twofactor_email', this.text, this.options || {})
Expand Down
18 changes: 17 additions & 1 deletion src/service/registration.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import Axios from '@nextcloud/axios'
import { generateUrl } from 'nextcloud-server/dist/router'
import { generateUrl } from 'nextcloud-server/dist/router.js'

/**
* Starts the verification.
*
* @return {Promise<any>}
*/
export function startVerification() {
const url = generateUrl('/apps/twofactor_email/settings/enable')

return Axios.post(url).then(resp => resp.data)
}

/**
* Compares the entered code with the generated/saved one.
*
* @param {string} code the user entered
* @return {Promise<any>}
*/
export function tryVerification(code) {
const url = generateUrl('/apps/twofactor_email/settings/validate')

Expand All @@ -15,6 +26,11 @@ export function tryVerification(code) {
}).then(resp => resp.data)
}

/**
* Disables the Two-Factor method for this user.
*
* @return {Promise<any>}
*/
export function disable() {
const url = generateUrl('/apps/twofactor_email/settings/disable')

Expand Down

0 comments on commit f070464

Please sign in to comment.