Browse Source

Merge pull request #3110 from nocodb/fix/gui-v2-reset-pwd-flow

fix(gui-v2): sign out after reset pwd like v1
pull/3113/head
navi 2 years ago committed by GitHub
parent
commit
053152bf08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      packages/nc-gui-v2/pages/index/user/index/index.vue

11
packages/nc-gui-v2/pages/index/user/index/index.vue

@ -1,8 +1,9 @@
<script lang="ts" setup>
import { useI18n } from 'vue-i18n'
import { message } from 'ant-design-vue'
import { navigateTo } from '#app'
import { extractSdkResponseErrorMsg } from '~/utils'
import { reactive, ref, useApi } from '#imports'
import { reactive, ref, useApi, useGlobal } from '#imports'
import MaterialSymbolsWarning from '~icons/material-symbols/warning'
import MdiKeyChange from '~icons/mdi/key-change'
@ -10,6 +11,8 @@ const { api } = useApi()
const { t } = useI18n()
const { signOut } = useGlobal()
const formValidator = ref()
let error = $ref<string | null>(null)
@ -51,11 +54,13 @@ const passwordChange = async () => {
error = null
try {
const { msg } = await api.auth.passwordChange({
await api.auth.passwordChange({
currentPassword: form.currentPassword,
newPassword: form.password,
})
message.success(msg)
message.success('Password changed successfully. Please login again.')
signOut()
navigateTo('/signin')
} catch (e: any) {
error = await extractSdkResponseErrorMsg(e)
}

Loading…
Cancel
Save