fix(login): add CORS permissions to main.ts, modify login route to include versioning
This commit is contained in:
parent
44b064b87f
commit
28b2a7ccd8
|
|
@ -1775,7 +1775,7 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"/auth/login": {
|
||||
"/auth/v1/login": {
|
||||
"get": {
|
||||
"operationId": "AuthController_login",
|
||||
"parameters": [],
|
||||
|
|
|
|||
|
|
@ -31,12 +31,18 @@ async function bootstrap() {
|
|||
rolling: true,
|
||||
cookie: {
|
||||
maxAge: 30 * 60 * 1000,
|
||||
httpOnly: false,
|
||||
httpOnly: true,
|
||||
}
|
||||
}))
|
||||
app.use(passport.initialize());
|
||||
app.use(passport.session());
|
||||
|
||||
// Enable CORS
|
||||
app.enableCors({
|
||||
origin: 'http://localhost:9000',
|
||||
credentials: true,
|
||||
});
|
||||
|
||||
//swagger config
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('Targo_Backend')
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import { Request, Response } from 'express';
|
|||
export class AuthController {
|
||||
|
||||
@UseGuards(OIDCLoginGuard)
|
||||
@Get('/login')
|
||||
@Get('/v1/login')
|
||||
login() {}
|
||||
|
||||
@Get('/callback')
|
||||
@UseGuards(OIDCLoginGuard)
|
||||
loginCallback(@Req() req: Request, @Res() res: Response) {
|
||||
res.redirect('/');
|
||||
res.redirect('http://localhost:9000/#/login-success');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user