From bf3607c737a3805da07848e85ca185f38624a602 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 12 Mar 2021 01:38:29 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 15 +----- ayanova/src/api/authutil.js | 2 + ayanova/src/store.js | 3 ++ ayanova/src/views/home-security.vue | 22 ++++++-- ayanova/src/views/login.vue | 84 +++++++++++++++++------------ 5 files changed, 74 insertions(+), 52 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 9b2ae2d7..9573a97e 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -192,21 +192,7 @@ todo: 2fa is going to be an absolute must have pretty soon, look into what's inv https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3395 Process: - SIGN UP - (copied a bit from digital ocean) - User settings has a SECURITY section where control 2fa stuff - user chooses 2fa button to setup, a dialog pops up sends a request to server at which point a secret key for 2fa is generated and stored in the User account - and gets back the secret to display in a qr code on screen to searching - /auth/setup-totp - user is redirected to a client form with the qr code displayed for teh secret - User gets QR code then displayed to sign up with auth software - User has to enter a valid code to save or enable 2fa fully otherwise it's not enabled if they cancel out - until the correct code is entered it will not be enabled yet - If user moves out of 2fa area without validating then it generates a new secret next time they go In - DISABLE - user goes to user settings->Security and click on disable 2fa button which is only enabled to click when the account has 2fa already enabled - this removes the 2fa secret from their account and sets 2fa off. LOGIN User logs in as normal, server checks if they have 2fa enabled if no 2fa enabled then send back token as normal @@ -215,6 +201,7 @@ todo: 2fa is going to be an absolute must have pretty soon, look into what's inv client sees it's a 2fa and redirects to a page (or login page has a "dialog") to enter 2fa 6 digit code temp token and 2fa 6 digit code is sent to a /verify route if they match / pass then the normal token is sent back and login proceeds as normal + NO TOKEN IS SENT ON 2fa enabled account without pin verification diff --git a/ayanova/src/api/authutil.js b/ayanova/src/api/authutil.js index 00a0a686..805a8a1e 100644 --- a/ayanova/src/api/authutil.js +++ b/ayanova/src/api/authutil.js @@ -13,6 +13,8 @@ export function processLogin(authResponse, loggedInWithKnownPassword) { return reject(); } + + //is token present? if (!authResponse || !authResponse.token) { window.$gz.store.commit( diff --git a/ayanova/src/store.js b/ayanova/src/store.js index c56de477..72ba84e8 100644 --- a/ayanova/src/store.js +++ b/ayanova/src/store.js @@ -162,6 +162,9 @@ export default new Vuex.Store({ }, setNewNotificationCount(state, data) { state.newNotificationCount = data; + }, + setTfaEnabled(state, data) { + state.tfaEnabled = data; } }, actions: {} diff --git a/ayanova/src/views/home-security.vue b/ayanova/src/views/home-security.vue index c420f0ba..d70139a5 100644 --- a/ayanova/src/views/home-security.vue +++ b/ayanova/src/views/home-security.vue @@ -2,12 +2,26 @@ +