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

Use info logic/#82 #90

Closed
wants to merge 14 commits into from
Closed

Use info logic/#82 #90

wants to merge 14 commits into from

Conversation

seonghunYang
Copy link
Collaborator

πŸ“Œ μž‘μ—… λ‚΄μš©

κ΅¬ν˜„ λ‚΄μš© 및 μž‘μ—… ν–ˆλ˜ λ‚΄μ—­

  • λ‘œκ·Έμ•„μ›ƒ 및 νšŒμ›νƒˆν‡΄ 둜직, 그리고 μ»΄ν¬λ„ŒνŠΈ κ΅¬ν˜„
  • mockμ—μ„œ 인증 κ΄€λ ¨ 둜직 μˆ˜μ •
  • 미듀웨어 λΌμš°νŒ… 둜직 μˆ˜μ •

πŸ€” κ³ λ―Ό ν–ˆλ˜ λΆ€λΆ„

  • 인증 둜직으둜 ν…ŒμŠ€νŠΈκ°€ μ–΄λ €μ›Œμ§€λŠ” 문제λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•΄, 개발 λͺ¨λ“œμΌ λ•Œλ§Œ 인증 처리λ₯Ό ν•˜λŠ” devModeAuthGuard() ν•¨μˆ˜λ₯Ό κ΅¬ν˜„ν–ˆμŠ΅λ‹ˆλ‹€.
  • 또 λ‹€λ₯Έ 해결책은 next/header의 μΏ ν‚€λ₯Ό λͺ¨μ˜ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. 이에 λŒ€ν•΄ user-info-navigator μ»΄ν¬λ„ŒνŠΈμ—μ„œ μž‘μ„±ν–ˆμŠ΅λ‹ˆλ‹€.
  • μ–΄λŠ μ •λ„κΉŒμ§€ mock을 μœ μ§€ν•˜κ³  관리해야 ν•˜λŠ”μ§€μ— λŒ€ν•œ 고민은 항상 μžˆλŠ” 것 κ°™μŠ΅λ‹ˆλ‹€. 개발의 νŽΈμ˜μ„±μ„ μœ„ν•΄ AuthGuard()λ₯Ό μ œκ±°ν•  μˆ˜λ„ μžˆμ§€λ§Œ, λ‚˜μ€‘μ— λ™μž‘μ„ μ •ν™•ν•˜κ²Œ λͺ¨μ˜ν•΄μ•Ό ν•  ν•„μš”κ°€ μžˆμ„ λ•Œ μ‚¬μš©ν•˜μ‹œλ©΄ λ©λ‹ˆλ‹€.

πŸ”Š 도움이 ν•„μš”ν•œ λΆ€λΆ„

  • user.command 파일이 λ„ˆλ¬΄ ν¬λ„€μš”. λ‘œμ§λ³„λ‘œ νŒŒμΌμ„ λΆ„λ¦¬ν•˜λŠ” 것을 κ³ λ €ν•˜κ³  μžˆλŠ”λ°. μ—¬λŸ¬λΆ„μ˜ μ˜κ²¬μ„ λ“£κ³  μ‹Άμ–΄μš”.

Copy link

Copy link

Copy link
Member

@yougyung yougyung left a comment

Choose a reason for hiding this comment

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

μˆ˜κ³ ν•˜μ…¨μŠ΅λ‹ˆλ‹€ !
인증 κ΄€λ ¨ ν…ŒμŠ€νŠΈμ˜ 진행에 μžˆμ–΄ μˆ˜κ³ ν•΄μ£Όμ‹  덕뢄에 devModeAuthGuard()을 μœ μš©ν•˜κ²Œ μ‚¬μš©ν•  수 μžˆμ„ 것 κ°™μŠ΅λ‹ˆλ‹€.

user.command 파일이 λ„ˆλ¬΄ ν¬λ„€μš”. λ‘œμ§λ³„λ‘œ νŒŒμΌμ„ λΆ„λ¦¬ν•˜λŠ” 것을 κ³ λ €ν•˜κ³  μžˆλŠ”λ°. μ—¬λŸ¬λΆ„μ˜ μ˜κ²¬μ„ λ“£κ³  μ‹Άμ–΄μš”.

κ°€ν˜„μ΄μ˜ auth와 userλ₯Ό λΆ„λ¦¬ν•˜μžλŠ” 의견이 μ’‹μ•„λ³΄μž…λ‹ˆλ‹€.

Comment on lines +35 to +37
return {
authId: 'admin',
};
Copy link
Member

Choose a reason for hiding this comment

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

개발 λͺ¨λ“œκ°€ μ•„λ‹λ•ŒλŠ”

 return {
    authId: '',
  };

을 λ°˜ν™˜ν•΄μ•Όν•˜λŠ” 것 μ•„λ‹Œκ°€μš”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • λ¨Όμ €, 기쑴의 mock λ‘œμ§μ„ ν™œμš©ν•˜λ €λ©΄ authIdκ°€ ν•„μš”ν•©λ‹ˆλ‹€. λ”°λΌμ„œ 개발 λͺ¨λ“œκ°€ μ•„λ‹Œ ν…ŒμŠ€νŠΈ μƒν™©μ—μ„œλŠ” admin κ³„μ •μœΌλ‘œ μ§„ν–‰ν•œλ‹€λŠ” κ°€μ • ν•˜μ— 이λ₯Ό κ΅¬μ„±ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

@seonghunYang
Copy link
Collaborator Author

1

@seonghunYang
Copy link
Collaborator Author

캑처

  • 쒋은 μ§ˆλ¬Έμ΄λ„€μš”. 이벀트 ν•Έλ“€λŸ¬μ— λŒ€ν•΄, μ €λŠ” λ°˜λ“œμ‹œ wrapper ν•¨μˆ˜λ₯Ό μƒμ„±ν•˜μ—¬ μ •μ˜ν•˜λŠ” 방식을 μ΄μš©ν•©λ‹ˆλ‹€. 이λ₯Ό μœ„ν•œ μ΄μœ λŠ” 두 κ°€μ§€μž…λ‹ˆλ‹€.
  • 가독성: μ»΄ν¬λ„ŒνŠΈλ₯Ό μ‚΄νŽ΄λ³Ό λ•Œ μ–΄λ–€ 이벀트 ν•Έλ“€λŸ¬μ™€ 둜직이 μžˆλŠ”μ§€ ν•œλˆˆμ— λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ, μ»΄ν¬λ„ŒνŠΈμ™€ λ‘œμ§μ„ λΆ„λ¦¬ν•˜λŠ” μž₯점도 μžˆμŠ΅λ‹ˆλ‹€(ν½λ‹ˆλ‹€).
  • ν™•μž₯μ„±: 이벀트 ν•Έλ“€λŸ¬μ—μ„œλŠ” λΉ„μ¦ˆλ‹ˆμŠ€ λ‘œμ§μ„ μž‘μ„±ν•˜λŠ” κ²½μš°κ°€ λ§ŽμŠ΅λ‹ˆλ‹€. μ²˜μŒμ—λŠ” λ‚΄μš©μ΄ μž‘μ•„μ„œ 인라인 ν•  수 μžˆμ§€λ§Œ, λ‚΄μš©μ΄ μ‰½κ²Œ ν™•μž₯될 수 있기 λ•Œλ¬Έμ— λ³„λ„λ‘œ λΆ„λ¦¬ν•©λ‹ˆλ‹€.
  • μ“°κ³ λ³΄λ‹ˆ ν™•μž₯ κ°€λŠ₯성은 그리 쒋은 이유둜 보이진 μ•Šκ³  가독성이 더 μ€‘μš”ν•œ 이유둜 λ³΄μž…λ‹ˆλ‹€.

@seonghunYang
Copy link
Collaborator Author

λ‚˜λ¨Έμ§€ 사항듀은 μˆ˜μ •μ΄ ν•„μš”ν•˜λ―€λ‘œ, μˆ˜μ •ν•œ 후에 μ—…λ‘œλ“œ ν•˜κ² μŠ΅λ‹ˆλ‹€.

user.command νŒŒμΌμ€ 쒋은 μ˜κ²¬μ„ μ£Όμ‹  덕뢄에, 둜직 λ‹¨μœ„λ‘œ λΆ„λ¦¬ν•˜κΈ° 전에 λ¨Όμ € auth와 userλ₯Ό λΆ„λ¦¬ν•˜λ„λ‘ ν•˜κ² μŠ΅λ‹ˆλ‹€.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants