aboutsummaryrefslogtreecommitdiff
path: root/src/components/mfa_form/totp_form.vue
blob: 9401cad554d2c9ab5d0c0766d7d35e2034878a2e (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
  <div class="login panel panel-default">
    <!-- Default panel contents -->

    <div class="panel-heading">
      {{ $t('login.heading.totp') }}
    </div>

    <div class="panel-body">
      <form
        class="login-form"
        @submit.prevent="submit"
      >
        <div class="form-group">
          <label for="code">
            {{ $t('login.authentication_code') }}
          </label>
          <input
            id="code"
            v-model="code"
            class="form-control"
          >
        </div>

        <div class="form-group">
          <div class="login-bottom">
            <div>
              <a
                href="#"
                @click.prevent="requireRecovery"
              >
                {{ $t('login.enter_recovery_code') }}
              </a>
              <br>
              <a
                href="#"
                @click.prevent="abortMFA"
              >
                {{ $t('general.cancel') }}
              </a>
            </div>
            <button
              type="submit"
              class="btn btn-default"
            >
              {{ $t('general.verify') }}
            </button>
          </div>
        </div>
      </form>
    </div>

    <div
      v-if="error"
      class="form-group"
    >
      <div class="alert error">
        {{ error }}
        <FAIcon
          size="lg"
          class="fa-scale-110 fa-old-padding"
          icon="times"
          @click="clearError"
        />
      </div>
    </div>
  </div>
</template>
<script src="./totp_form.js"></script>