Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NDD-172]: 로그인 완료 시 마이페이지로 리다이렉트 되도록 구현 (1h / 1h) #58

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

quiet-honey
Copy link
Collaborator

@quiet-honey quiet-honey commented Nov 16, 2023

NDD-172 Powered by Pull Request Badge

Why

FE에서 로그인 완료 시 마이페이지로 리다이렉트가 되도록 요청을 하셔서 이를 반영

How

단순하게 로그인 완료 시 send로 클라이언트로 반환하던 로직을 redirect로 반환하도록 하여 마이페이지로 바로 리다이렉트 되도록 구현하였다.

  async googleAuthCallback(
    @Req() req: Request,
    @Res() res: Response,
  ): Promise<void> {
    const { user } = req;
    const userRequest = user as OAuthRequest;
    res
      .status(201)
      .cookie(
        'accessToken',
        await this.authService.login(userRequest),
        COOKIE_OPTIONS,
      )
      .redirect('https://www.gomterview.com/mypage');
  }

Result

로그인 완료 시 마이페이지로 자동 리다이렉트

Prize

바로 필요한 페이지로 리다이렉트 되기에 UX 향상 기대
FE에서 로그인 구현 편의성 증대

@quiet-honey quiet-honey added BE 백엔드 코드 변경사항 feature 새로운 기능이 추가 된 경우 labels Nov 16, 2023
@quiet-honey quiet-honey self-assigned this Nov 16, 2023
Copy link
Collaborator

@JangAJang JangAJang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!!

@quiet-honey quiet-honey merged commit 98dd5c8 into dev Nov 16, 2023
1 check passed
@delete-merged-branch delete-merged-branch bot deleted the feature/NDD-172 branch November 16, 2023 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 백엔드 코드 변경사항 feature 새로운 기능이 추가 된 경우
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants