-
Notifications
You must be signed in to change notification settings - Fork 1
fix: 로그아웃 시, 익스텐션 토큰 제거 #246
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,11 +2,11 @@ | |
| if (details.reason === 'install') { | ||
| chrome.identity.getProfileUserInfo(function (info) { | ||
| chrome.storage.local.set({ email: info.email }, () => { | ||
| console.log('User email saved:'); | ||
| }); | ||
| setTimeout(() => { | ||
| chrome.tabs.create({ | ||
| url: `https://www.pinback.today/onboarding?email=${info.email}`, | ||
| url: `https://pinback.today/onboarding?email=${info.email}`, | ||
| }); | ||
| }, 1000); | ||
| }); | ||
|
|
@@ -16,7 +16,15 @@ | |
| chrome.runtime.onMessage.addListener((message) => { | ||
| if (message.type === 'SET_TOKEN') { | ||
| chrome.storage.local.set({ token: message.token }, () => { | ||
| console.log('Token saved!'); | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| chrome.runtime.onMessage.addListener((message) => { | ||
| if (message.type === 'Extension-Logout') { | ||
| chrome.storage.local.remove('token', () => { | ||
| console.log('Token removed!'); | ||
| }); | ||
| } | ||
| }); | ||
|
Comment on lines
+24
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: rg -n "Extension-Logout" --type ts -C 5Repository: Pinback-Team/pinback-client Length of output: 2307 background.ts의 Extension-Logout 리스너는 실제로 호출되지 않습니다.
이 리스너는 제거하거나, 🧰 Tools🪛 GitHub Check: lint[warning] 27-27: 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,7 +6,16 @@ | |||||||||||||||||||||||||||||||||||
| token: event.data.token, | ||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||
| chrome.storage.local.set({ token: event.data.token }, () => { | ||||||||||||||||||||||||||||||||||||
| console.log('Token saved!', event.data.token); | ||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| window.addEventListener('message', (event) => { | ||||||||||||||||||||||||||||||||||||
| if (event.source !== window) return; | ||||||||||||||||||||||||||||||||||||
| if (event.data.type === 'Extension-Logout') { | ||||||||||||||||||||||||||||||||||||
| chrome.storage.local.remove('token', () => { | ||||||||||||||||||||||||||||||||||||
| console.log('Token removed!'); | ||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
일관성을 위해 background에도 메시지를 전달하거나, 🔧 background로 메시지 전달 추가 window.addEventListener('message', (event) => {
if (event.source !== window) return;
if (event.data.type === 'Extension-Logout') {
+ chrome.runtime.sendMessage({ type: 'Extension-Logout' });
chrome.storage.local.remove('token', () => {
console.log('Token removed!');
});
}
});📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: lint[warning] 18-18: 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||
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.
401/403 에러 시 토큰 제거 로직 비활성화에 대한 검토가 필요합니다.
인증 에러(401/403) 발생 시 토큰을 제거하지 않고 온보딩 페이지로 리다이렉트만 하는 것은 다음과 같은 문제를 야기할 수 있습니다:
이 변경의 의도가 있다면 주석으로 사유를 명시하거나, 토큰 제거 로직을 유지하는 것을 권장합니다.
🔒 토큰 제거 로직 복원 제안
🤖 Prompt for AI Agents