-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
after login redirect to path the user tried to visit
- Loading branch information
Showing
2 changed files
with
4 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,13 @@ import InputText from "primevue/inputtext"; | |
import Button from "primevue/button"; | ||
import Toast from 'primevue/toast'; | ||
import { ref } from "vue"; | ||
import { useRouter } from "vue-router"; | ||
import { useRouter, useRoute } from "vue-router"; | ||
import { client, setLogin } from "../lib/api"; | ||
import { useToast } from 'primevue/usetoast'; | ||
const toast = useToast(); | ||
const router = useRouter(); | ||
const route = useRoute(); | ||
const loading = ref(false); | ||
const email = ref(import.meta.env.PROD ? "" : "[email protected]"); | ||
|
@@ -24,7 +25,7 @@ const onSubmit = async () => { | |
setLogin(response.data.user, response.data.authorization.token) | ||
router.push('/orga') | ||
router.push(route.query.redirect || '/orga') | ||
} catch (error) { | ||
console.error(error) | ||
toast.add({ severity: 'error', summary: 'Login war nicht erfolgreich', life: 6000 }); | ||
|