Skip to content

Commit d99e905

Browse files
committed
fix(comment): fix comments
1 parent 77c40b6 commit d99e905

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/oauth2/oauth.controller.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Response } from 'express';
21
import { Public } from 'omniboxd/auth/decorators/public.auth.decorator';
32
import { UserId } from 'omniboxd/decorators/user-id.decorator';
43
import { OAuthService } from 'omniboxd/oauth2/oauth.service';
@@ -8,7 +7,6 @@ import {
87
Post,
98
Query,
109
Body,
11-
Res,
1210
BadRequestException,
1311
} from '@nestjs/common';
1412

@@ -23,7 +21,6 @@ export class OAuthController {
2321
@Query('redirect_uri') redirectUri: string,
2422
@Query('state') state: string,
2523
@UserId() userId: string,
26-
@Res() res: Response,
2724
) {
2825
if (responseType !== 'code') {
2926
throw new BadRequestException(
@@ -47,7 +44,10 @@ export class OAuthController {
4744
redirectUrl.searchParams.set('state', state);
4845
}
4946

50-
res.redirect(redirectUrl.toString());
47+
// Most browsers will block automatic redirects, so we perform the redirect manually
48+
return {
49+
redirectUrl: redirectUrl.toString(),
50+
};
5151
}
5252

5353
@Public()

0 commit comments

Comments
 (0)