Add return URL to login form

This commit is contained in:
Andrew Kingston 2021-05-20 14:47:36 +01:00
parent 74a8eb4c1a
commit 99a2a5caf0
1 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<script>
import { goto } from "@roxi/routify"
import { goto, params } from "@roxi/routify"
import {
notifications,
Input,
@ -22,8 +22,12 @@
username,
password,
})
if ($params["?returnUrl"]) {
window.location = decodeURIComponent($params["?returnUrl"])
} else {
notifications.success("Logged in successfully")
$goto("../portal")
}
} catch (err) {
console.error(err)
notifications.error("Invalid credentials")