diff --git a/components/header/header.vue b/components/header/header.vue index 505bdb8..1d87ebc 100644 --- a/components/header/header.vue +++ b/components/header/header.vue @@ -138,7 +138,7 @@ function search() { async function logout() { del('/session'); - window.location.reload(); + navigate('/login', null, { redirect: true }); } diff --git a/pages/auth/login/+Page.vue b/pages/auth/login/+Page.vue index 3915bee..53f2536 100644 --- a/pages/auth/login/+Page.vue +++ b/pages/auth/login/+Page.vue @@ -98,13 +98,13 @@ async function login() { errorMsg.value = null; try { - await post('/session', { + const loginUser = await post('/session', { username: username.value, password: password.value, redirect: pageContext.urlParsed.search.r, }); - navigate(decodeURIComponent(pageContext.urlParsed.search.r), null, { redirect: true }); + navigate(pageContext.urlParsed.search.r ? decodeURIComponent(pageContext.urlParsed.search.r) : `/user/${loginUser.username}`, null, { redirect: true }); } catch (error) { errorMsg.value = error.message; } diff --git a/pages/auth/signup/+Page.vue b/pages/auth/signup/+Page.vue new file mode 100644 index 0000000..b02fc80 --- /dev/null +++ b/pages/auth/signup/+Page.vue @@ -0,0 +1,236 @@ + + + + You are already logged in as {{ user.username }}. + + + + View my profile + + + + Check out latest porn updates + + + + Browse the hottest porn stars + + + + + + {{ errorMsg }} + + + + + + + + + + + + + + + + + + + + + + + + + + Sign up + + I already have an account + + + + + + + diff --git a/pages/auth/signup/+route.js b/pages/auth/signup/+route.js new file mode 100644 index 0000000..001229a --- /dev/null +++ b/pages/auth/signup/+route.js @@ -0,0 +1 @@ +export default '/signup'; diff --git a/pages/users/@username/+Page.vue b/pages/users/@username/+Page.vue index c993ab3..2c99594 100644 --- a/pages/users/@username/+Page.vue +++ b/pages/users/@username/+Page.vue @@ -17,8 +17,6 @@ import { inject } from 'vue'; const pageContext = inject('pageContext'); const profile = pageContext.pageProps.profile; - -console.log('profile', profile);