Added signup page.

This commit is contained in:
2024-02-29 06:00:12 +01:00
parent f32722ee7c
commit 082d4fc154
10 changed files with 277 additions and 26 deletions

View File

@@ -17,8 +17,6 @@ import { inject } from 'vue';
const pageContext = inject('pageContext');
const profile = pageContext.pageProps.profile;
console.log('profile', profile);
</script>
<style scoped>

View File

@@ -1,8 +1,14 @@
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
import { fetchUser } from '#/src/users.js';
export async function onBeforeRender(pageContext) {
const profile = await fetchUser(pageContext.routeParams.username);
if (!profile) {
throw render(404, `Cannot find user '${pageContext.routeParams.username}'.`);
}
return {
pageContext: {
title: profile.username,