|
1 | 1 | import { Request, Response } from "express"; |
2 | | -import AuthService, { assertAllowedRedirectUri } from "../services/auth.service"; |
| 2 | +import AuthService, { resolveRedirectUri } from "../services/auth.service"; |
3 | 3 | import { AppError } from "../../errors/AppError"; |
4 | 4 | import { CompleteSignupDto } from "../dtos/complete-signup.dto"; |
5 | 5 | import { validate } from "class-validator"; |
@@ -328,8 +328,8 @@ class AuthController { |
328 | 328 | }); |
329 | 329 | } |
330 | 330 |
|
331 | | - const validatedRedirectUri = assertAllowedRedirectUri(redirect_uri); |
332 | | - const result = await AuthService.exchangeKakaoToken(code, validatedRedirectUri); |
| 331 | + const resolvedRedirectUri = resolveRedirectUri("KAKAO", redirect_uri); |
| 332 | + const result = await AuthService.exchangeKakaoToken(code, resolvedRedirectUri); |
333 | 333 |
|
334 | 334 | res.status(200).json({ |
335 | 335 | message: "카카오 로그인이 완료되었습니다.", |
@@ -365,8 +365,8 @@ class AuthController { |
365 | 365 | }); |
366 | 366 | } |
367 | 367 |
|
368 | | - const validatedRedirectUri = assertAllowedRedirectUri(redirect_uri); |
369 | | - const result = await AuthService.exchangeGoogleToken(code, validatedRedirectUri); |
| 368 | + const resolvedRedirectUri = resolveRedirectUri("GOOGLE", redirect_uri); |
| 369 | + const result = await AuthService.exchangeGoogleToken(code, resolvedRedirectUri); |
370 | 370 |
|
371 | 371 | res.status(200).json({ |
372 | 372 | message: "구글 로그인이 완료되었습니다.", |
@@ -402,8 +402,8 @@ class AuthController { |
402 | 402 | }); |
403 | 403 | } |
404 | 404 |
|
405 | | - const validatedRedirectUri = assertAllowedRedirectUri(redirect_uri); |
406 | | - const result = await AuthService.exchangeNaverToken(code, validatedRedirectUri); |
| 405 | + const resolvedRedirectUri = resolveRedirectUri("NAVER", redirect_uri); |
| 406 | + const result = await AuthService.exchangeNaverToken(code, resolvedRedirectUri); |
407 | 407 |
|
408 | 408 | res.status(200).json({ |
409 | 409 | message: "네이버 로그인이 완료되었습니다.", |
|
0 commit comments