leapfrogai
leapfrogai copied to clipboard
feat(API): Add authentication
User Story
As a LeapfrogAI user I want authentication for LeapfrogAI API So that my data is secure and separated.
Additional context
The OpenAI spec uses API keys for the user.
Idea: Have the UI lookup the User's API Key in Supabase and pass it to the API so the API spec remains compliant with OpenAI.
When does the API key get created?
-
The first time user logs into
ai.xxx.xxxgenerate the key -
[ ] Update profile table in the database to store the api-key
-
[ ] consider using jwt/session token to add more security by making the calls expire and be more transactionally validated
- In this case, the key can be the JWT token
Will be turning on RLS for backend tables as a part of this.