-
Notifications
You must be signed in to change notification settings - Fork 0
feat: browse 페이지에 로그인 기능 추가 #9
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
base: main
Are you sure you want to change the base?
Conversation
| } from '~/server/api/trpc'; | ||
| export const s3Router = createTRPCRouter({ | ||
| listUserFiles: publicProcedure | ||
| listUserFiles: protectedProcedure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 변경으로 authorization이 완전히 충족되는지는 모르겠으나, 이 엔드포인트를 이런 식으로 막아도 딱 원하는 동작까지는 달성할 수 있었고, https://4cut.us/download/[userId]/${filename}은 여전히 토큰 인증 없이도 동작함을 확인했습니다.
gomjellie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳
638b999 to
4334c60
Compare
4334c60 to
d70fc37
Compare
1cce8b2 to
0ea6c77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제거된 것으로 뜨지만, 아래 index.tsx 파일로 이름이 변경된 것. git mv 등을 사용해도 두 파일을 합치는 것이 불가능 한 듯...
추가 변경 내역은 다음 커밋 참조: 0ea6c77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 diff 안만들고 먼저 파일명만 바꾸는 커밋 만든다음에 index.tsx 내용을 바꾸면됨
설명
/browse엔드포인트에 Bearer 인증을 통한 로그인 기능을 추가합니다.세부사항
userId를 path에 제공하여 접속하는/browse/[userId]방식에서, 모든 계정이 동일하게/browse에 접속하는 방식으로 바뀌었습니다.account.getCurrentUser와account.signInAPI를 사용해야해서 약간 내용이 방대해지긴 했지만,window.prompt같은 요소만을 사용해서 변경을 최소화 했습니다.?login=0처럼 보내면 이전 계정의 토큰이 삭제되어 마찬가지로 로그인을 재시도 할 수 있습니다.Github Copilot (Claude Sonnet 3.5) 으로 작성했기 때문에 최신 트렌드와 맞지 않거나 코드베이스 상의 설계 방식과 다를 수 있습니다. 조언 부탁드립니다!