Skip to content

Commit 36b32eb

Browse files
committed
add cookie parser and prep for events
1 parent ac9e771 commit 36b32eb

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

examples_new/microservices/auth/src/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import dotenv from 'dotenv';
44
dotenv.config();
55
import { NotFoundError, errorHandler } from '@chronosrx/common';
66
import authRouter from './routes/auth-router';
7+
import cookieParser from 'cookie-parser';
78

89
const app = express();
910

1011
app.use(express.json());
12+
app.use(cookieParser())
1113

1214
// app.get('/', (req, res) => {
1315
// console.log('💥 Test Route');

examples_new/microservices/auth/src/controllers/auth-controller.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export const signup = async (req: Request, res: Response) => {
2626
// save newly created user document to the database
2727
await newUser.save();
2828

29+
// TODO PUBLISH AN EVENT TO THE EVENT BUS - type USER_CREATED, with data of user - user.id & username
30+
2931
// create a JWT w/ userId store on it
3032
// note: createJwt method created on the userSchema
3133
const token = newUser.createJwt();

0 commit comments

Comments
 (0)