MCPcopy Create free account
hub / github.com/bsoc-bitbyte/busify / getCurrentUser

Method getCurrentUser

backend/src/Auth/auth.service.ts:56–68  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

54 }
55 // /me route handler
56 async getCurrentUser(req) {
57 if (!req.user) {
58 throw new UnauthorizedException(
59 'You are not logged in or there may be an error. Please log in again.'
60 );
61 }
62 const user = await this.prisma.users.findUnique({
63 where: {
64 id: req.user.id,
65 },
66 });
67 return user;
68 }
69
70 // /logout route handler
71 async logout(res) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected