feature implement login part2

This commit is contained in:
Edd
2025-12-20 21:59:33 +00:00
parent ae6a0b4706
commit a566387998
5 changed files with 50 additions and 33 deletions
+9 -9
View File
@@ -64,16 +64,16 @@ const formData = ref({
const handleSubmit = async () => {
console.log(formData, authStore)
toast.promise(authStore.login(formData.value), {
loading: 'Calling API',
success: (data) => {
return `Login Sucessfull - ${data?.name}`
},
error: (data) => `[API] Error - ${data?.response?.data?.message}`
const promise = authStore.login(formData.value)
toast.promise(promise, {
loading: 'Calling API',
success: (user) => {
router.push('/')
return `Login Successful - ${user.name}`
},
error: (error) =>
error.response?.data?.message
})
router.push('/')
}
</script>