feat: add avatar (#47)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import type { LoaderFunctionArgs } from '@remix-run/cloudflare';
|
||||
import { json, type LoaderFunctionArgs } from '@remix-run/cloudflare';
|
||||
import { default as IndexRoute } from './_index';
|
||||
import { handleAuthRequest } from '~/lib/.server/login';
|
||||
import { loadWithAuth } from '~/lib/.server/auth';
|
||||
|
||||
export async function loader(args: LoaderFunctionArgs) {
|
||||
return handleAuthRequest(args, { id: args.params.id });
|
||||
return loadWithAuth(args, async (_args, session) => json({ id: args.params.id, avatar: session.avatar }));
|
||||
}
|
||||
|
||||
export default IndexRoute;
|
||||
|
||||
Reference in New Issue
Block a user