diff --git a/src/components/screens/Login.vue b/src/components/screens/Login.vue index f60915d..13f245a 100644 --- a/src/components/screens/Login.vue +++ b/src/components/screens/Login.vue @@ -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('#') diff --git a/src/components/screens/partials/login/NewPasswordForm.vue b/src/components/screens/partials/login/NewPasswordForm.vue index fe0cbb2..7798ca7 100644 --- a/src/components/screens/partials/login/NewPasswordForm.vue +++ b/src/components/screens/partials/login/NewPasswordForm.vue @@ -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 = '/' } diff --git a/src/components/screens/partials/login/ResetPassword.vue b/src/components/screens/partials/login/ResetPasswordModal.vue similarity index 90% rename from src/components/screens/partials/login/ResetPassword.vue rename to src/components/screens/partials/login/ResetPasswordModal.vue index 3392fc7..75568ce 100644 --- a/src/components/screens/partials/login/ResetPassword.vue +++ b/src/components/screens/partials/login/ResetPasswordModal.vue @@ -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') }