diff options
| author | Adam Soltys <[email protected]> | 2022-10-17 23:29:32 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-17 23:29:32 -0700 |
| commit | 02af363d2f0d552a72dc1c90bf8d785e04465d3a (patch) | |
| tree | 03fe0719e4c623cf6d6b649c0867b910b6db5199 /src/routes/+layout.server.js | |
| parent | 5e3d4133760962db28c4f3a595f0566bd59391ff (diff) | |
| download | coinos-ui-02af363d2f0d552a72dc1c90bf8d785e04465d3a.tar.gz coinos-ui-02af363d2f0d552a72dc1c90bf8d785e04465d3a.zip | |
invoice redirect
Diffstat (limited to 'src/routes/+layout.server.js')
| -rw-r--r-- | src/routes/+layout.server.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/routes/+layout.server.js b/src/routes/+layout.server.js index 7f6e8801..6af13a06 100644 --- a/src/routes/+layout.server.js +++ b/src/routes/+layout.server.js @@ -5,7 +5,8 @@ import { env } from '$env/dynamic/public'; export const { PUBLIC_BTC: btc } = env; -export async function load({ cookies, request, url, params }) { +export async function load({ cookies, locals, request, url, params }) { + url.pathname; let token = cookies.get('token'); let user; let rates; @@ -16,11 +17,7 @@ export async function load({ cookies, request, url, params }) { } if (token && token !== 'undefined') { - try { - user = await get('/me', auth(cookies)); - } catch (e) { - throw redirect(307, '/logout'); - } + user = locals.user; if (protectedRoutes.find((p) => url.pathname.match(p))) { if (user.username !== params.username) throw error(404, 'user not found'); |
