mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Update api routes to use authenticated user
This commit is contained in:
@@ -3,11 +3,11 @@ import { NextHandler } from 'next-connect';
|
||||
import findUserById from '@/services/user/findUserById';
|
||||
import ServerError from '@/config/util/ServerError';
|
||||
import { getLoginSession } from '../session';
|
||||
import { ExtendedNextApiRequest } from '../types';
|
||||
import { UserExtendedNextApiRequest } from '../types';
|
||||
|
||||
/** Get the current user from the session. Adds the user to the request object. */
|
||||
const getCurrentUser = async (
|
||||
req: ExtendedNextApiRequest,
|
||||
req: UserExtendedNextApiRequest,
|
||||
res: NextApiResponse,
|
||||
next: NextHandler,
|
||||
) => {
|
||||
|
||||
Reference in New Issue
Block a user