feature implement login part2

This commit is contained in:
Edd committed 2025-12-20 21:59:33 +00:00
1 parent ae6a0b4706
commit a566387998
5 files changed
+50 -33

No files matched your search

+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>