Closed nang-dev closed 1 week ago
So this is going in the correct direction however I would say we have an authentication page we display in the system native browser on a temporary webserver, this way we can handle the callback logic and also leverage the users browser password manager for login or single-sign-on though apps like Google or Github.
We can either use a temporary webserver or we can create our own callback page and host it with vercel.
Using a webview from electron sucks from a UX perspective because if the user is using any 2FA on their sso account it will cause a lot of friction trying to authenticate or reauthenticate now/future
yes
Users need to sign in and use their info in the requests to the server
the code for this should live in pearai-submodule
my convo with chatgpt:
I am building a vscode extenison, how can i have a login on the extension, and then pass the username in each request in the extension code
In a TypeScript file within your VSCode extension,
context
usually refers to thevscode.ExtensionContext
object that is passed to theactivate
function of your extension. To accesscontext
in other parts of your extension, you can either pass it as an argument to the functions that need it or store it in a module-level variable when your extension activates.Here’s how you can manage it:
Step 1: Store
context
in a Module-Level VariableCreate a module to store the
context
. This allows other parts of your extension to access it easily.Step 2: Set
context
When Activating the ExtensionUpdate your
activate
function to set thecontext
using thesetContext
function.Step 3: Access
context
in Your Request FunctionNow, you can access the
context
in your request function using thegetContext
function.This approach ensures that you have access to the
context
in any part of your extension, and it keeps your code modular and organized.