1
0
forked from noxious/client

Renamed component, inform user when password reset mail has been sent, added comment for #238

This commit is contained in:
Dennis Postma 2024-11-05 01:02:27 +01:00
parent 9c244e980c
commit 270d12821a
3 changed files with 17 additions and 1 deletions

View File

@ -32,7 +32,7 @@ import { useCookies } from '@vueuse/integrations/useCookies'
import LoginForm from '@/components/screens/partials/login/LoginForm.vue'
import RegisterForm from '@/components/screens/partials/login/RegisterForm.vue'
import NewPasswordForm from '@/components/screens/partials/login/NewPasswordForm.vue'
import ResetPassword from '@/components/screens/partials/login/ResetPassword.vue'
import ResetPassword from '@/components/screens/partials/login/ResetPasswordModal.vue'
const isPasswordResetFormShown = ref(false)
const doesUrlHaveToken = window.location.hash.includes('#')

View File

@ -59,6 +59,15 @@ async function newPasswordFunc() {
newPasswordError.value = response.error
return
}
/**
* @TODO: #238, this wont work if we redirect to the login page
* Find a way to just "close" this screen instead of redirecting
*/
gameStore.addNotification({
title: 'Success',
message: 'Password changed successfully'
})
window.location.href = '/'
}

View File

@ -26,9 +26,11 @@
import { ref } from 'vue'
import { resetPassword } from '@/services/authentication'
import Modal from '@/components/utilities/Modal.vue'
import { useGameStore } from '@/stores/gameStore'
const emit = defineEmits(['close'])
const gameStore = useGameStore()
const email = ref('')
const resetPasswordError = ref('')
@ -47,6 +49,11 @@ async function resetPasswordFunc() {
return
}
gameStore.addNotification({
title: 'Success',
message: 'Password reset email sent'
})
emit('close')
}
</script>