Added basic login.
This commit is contained in:
14
pages/users/@username/+onBeforeRender.js
Normal file
14
pages/users/@username/+onBeforeRender.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { fetchUser } from '#/src/users.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
const profile = await fetchUser(pageContext.routeParams.username);
|
||||
|
||||
return {
|
||||
pageContext: {
|
||||
title: profile.username,
|
||||
pageProps: {
|
||||
profile, // differentiate from authed 'user'
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user