Skip to content

Commit

Permalink
Merge pull request #3110 from nocodb/fix/gui-v2-reset-pwd-flow
Browse files Browse the repository at this point in the history
fix(gui-v2): sign out after reset pwd like v1
  • Loading branch information
o1lab committed Aug 12, 2022
2 parents 14e054c + d2a5a81 commit 053152b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/nc-gui-v2/pages/index/user/index/index.vue
@@ -1,15 +1,18 @@
<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'
const { api } = useApi()
const { t } = useI18n()
const { signOut } = useGlobal()
const formValidator = ref()
let error = $ref<string | null>(null)
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 053152b

Please sign in to comment.