Skip to content

Commit 2a1ba79

Browse files
reset all
1 parent 346f834 commit 2a1ba79

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v1.0.2
2+
- otpauth-migration-parser fix
3+
- pbkdf2 fix
4+
- add pin simple code
5+
16
v1.0.0
27
- Add time sync
38
- Import keys from Google 2FA APP

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "smart2fa",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"private": true,
55
"description": "Alternative open source software for 2fa authorization",
66
"author": "technolog <technolog@smartholdem.io>",

src/store/modules/keys2fa.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ export default {
4343
},
4444

4545
mutations: {
46+
RESET(state) {
47+
state.pin = '';
48+
state.faKeys = [];
49+
},
4650
SET_PIN (state, payload) {
4751
state.pin = payload;
4852
},
@@ -73,6 +77,9 @@ export default {
7377
},
7478

7579
actions: {
80+
async reset({ commit }) {
81+
commit('RESET')
82+
},
7683
setKeys ({ commit }, value) {
7784
commit('SET_KEYS', value)
7885
},

src/views/Unlock.vue

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,21 @@
2424
@input="validatePin"
2525
></b-form-input>
2626
</b-form-group>
27-
<b-button :disabled="!isValid" type="submit" variant="primary" class="text-uppercase">Unlock</b-button>
27+
28+
<div class="row">
29+
30+
<div class="col-6">
31+
<b-button :disabled="!isValid" type="submit" variant="primary" class="w-100 text-uppercase">Unlock</b-button>
32+
</div>
33+
<div class="col-6">
34+
<b-button @click="resetAll" variant="danger" class="w-100 text-uppercase">Reset All data?</b-button>
35+
</div>
36+
37+
</div>
38+
39+
40+
41+
2842
</b-form>
2943
</div>
3044
</div>
@@ -44,6 +58,14 @@ export default {
4458
}
4559
},
4660
methods: {
61+
async resetAll() {
62+
await this.$store.dispatch('resetData');
63+
await this.$store.dispatch('keys2fa/reset');
64+
setTimeout(async () => {
65+
await this.$router.push('/set-pin');
66+
}, 500);
67+
68+
},
4769
async validatePin() {
4870
clearTimeout(this.unlockTimer);
4971
this.unlockTimer = setTimeout(async () => {

0 commit comments

Comments
 (0)