-
Notifications
You must be signed in to change notification settings - Fork 0
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
createRandomId, createHashedId 구현 #23
Conversation
- LogType에도 ServiceNameType을 적용합니다.
} | ||
|
||
hashedId = CryptoJS.SHA256(userId).toString(CryptoJS.enc.Base64); | ||
|
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.
지금 demo랑 Logger.ts의 로직을 보면 userIdr에 ''이 들어오게 되면 같은 비로그인유저임에도 불구하고 아이디가 매번 랜덤생성이 될수도 있겠다는 생각이 들거든요! 왜냐면 LogClick,LogScreen마다 initLog()를 해주고 그때마다 유저가 userId를 ''로 넣어주니까 같은 유저임이 식별이 안될수도 있겠다는 생각이 들었어용! 유저 생성을 정적으로 하는 방법에 대해서 고민해보는거 어떨까용?!
Drawer.tsx
name: 'click',
serviceName: 'home',
path: router.pathname,
userId: '',
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.
제가 잘못이해한걸수도 있어서 편하게 코멘트 달아주세용!
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.
첨부해 둔 demo app 실행결과 화면 보시면 같은 비로그인 유저는 동일한 hashedId가 저장되는 거 확인하실 수 있어요! localHashedId와 hashedId를 분리한 이유가 요거 처리하기 위해서였습니당
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.
아 로그인이후 뿐만 아니라 비회원유저 식별을 위해서도 로컬스토리지 값을 땡겨오는거군요! 이해했습니당 수고하셨어용!
1️⃣ 어떤 작업을 했나요? (Summary)
resolved [FEAT] 비로그인 사용자를 위한 random string 생성 #11 and [FEAT] createHashedId 함수 구현 #12
createHashedId 함수 구현
createRandomId 함수 구현
createHashedId() Flow
demo app 실행결과
기존 코드에 영향을 미치는 변경사항
demo app /drawer 경로는 userId를 ''로 설정하였습니다. => 비로그인 사용자 테스트용
3️⃣ 추후 작업
현재 Logger.ts에 너무 많은 로직들이 들어있는 상태라 몇 개 파일 분리 좀 할게용!
4️⃣ 체크리스트 (Checklist)
main
브랜치의 최신 코드를pull
받았나요?