Development
cd extension && yarn dev
cd api && yarn dev
Authentication logic
extension.ts
set up a temporary polka server to which the express server will redirect as authentication callback. vscode.open
direct user to the express server /auth/github
for authentication, when it is successful user is redirected to the polka server's dynamic route carrying their token, TokenManager
set the token as global state.
Authorization logic
-
Sidebar.svelte
mounts and post messageget-token
toSidebarProvider
-
SidebarProvider
receivesget-token
and then post messagetoken
back toSidebar.svelte
alongside with token value provided byTokenManager.getToken()
-
Sidebar.svelte
receivestoken
, send a request to the express server/me
route to identify the user