diff --git a/dashboard/src/components/EnableTwoFADialog.vue b/dashboard/src/components/EnableTwoFADialog.vue new file mode 100644 index 000000000..014aec780 --- /dev/null +++ b/dashboard/src/components/EnableTwoFADialog.vue @@ -0,0 +1,127 @@ + + + diff --git a/dashboard/src/models/ProfileModel.js b/dashboard/src/models/ProfileModel.js index 26d610f53..1a9324b00 100644 --- a/dashboard/src/models/ProfileModel.js +++ b/dashboard/src/models/ProfileModel.js @@ -179,10 +179,10 @@ function create() { return null; }, - async setTwoFASecret() { + async setTotpSecret() { let error, result; try { - result = await fetcher.post(`${API_ORIGIN}/api/v1/profile/twofactorauthentication_secret`, {}, { access_token: accessToken }); + result = await fetcher.post(`${API_ORIGIN}/api/v1/profile/totp_secret`, {}, { access_token: accessToken }); } catch (e) { error = e; } @@ -190,10 +190,10 @@ function create() { if (error || result.status !== 200) return [error || result]; return [null, result.body]; }, - async enableTwoFA(totpToken) { + async enableTotp(totpToken) { let error, result; try { - result = await fetcher.post(`${API_ORIGIN}/api/v1/profile/twofactorauthentication_enable`, { totpToken }, { access_token: accessToken }); + result = await fetcher.post(`${API_ORIGIN}/api/v1/profile/totp_enable`, { totpToken }, { access_token: accessToken }); } catch (e) { error = e; } @@ -204,7 +204,7 @@ function create() { async disableTwoFA(password) { let result; try { - result = await fetcher.post(`${API_ORIGIN}/api/v1/profile/twofactorauthentication_disable`, { password }, { access_token: accessToken }); + result = await fetcher.post(`${API_ORIGIN}/api/v1/profile/totp_disable`, { password }, { access_token: accessToken }); } catch (e) { return [e]; } diff --git a/dashboard/src/models/UsersModel.js b/dashboard/src/models/UsersModel.js index 0ea68d8d2..3068c70b7 100644 --- a/dashboard/src/models/UsersModel.js +++ b/dashboard/src/models/UsersModel.js @@ -202,7 +202,7 @@ function create() { async disableTwoFactorAuthentication(id) { let result; try { - result = await fetcher.post(`${API_ORIGIN}/api/v1/users/${id}/twofactorauthentication_disable`, {}, { access_token: accessToken }); + result = await fetcher.post(`${API_ORIGIN}/api/v1/users/${id}/totp_disable`, {}, { access_token: accessToken }); } catch (e) { return [e]; } diff --git a/dashboard/src/views/ProfileView.vue b/dashboard/src/views/ProfileView.vue index 123d0a5cb..05b905200 100644 --- a/dashboard/src/views/ProfileView.vue +++ b/dashboard/src/views/ProfileView.vue @@ -1,8 +1,7 @@