Skip to content
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

[Auth BE] AAUser I can access the unauthenticated Apigateway endpoints from the frontend using a Next API proxy route #243

Closed
mattzcarey opened this issue Sep 4, 2023 · 1 comment · Fixed by #246
Assignees

Comments

@mattzcarey
Copy link
Owner

mattzcarey commented Sep 4, 2023

Description:

This ticket is an alternative approach instead of #181
We will use an internal Nextjs API endpoint and then use an API key stored as environment variable to authenticate the core API.

See this code in quivr for the pattern. https://github.com/StanGirard/quivr/tree/main/frontend/lib/api
We create a bunch of functions in the api folder split by domain. For each domain we expose the function as part of a hook.

Validation:
screenshot of frontend with a user page.

Tech steps:
in lib/api make a user folder
in user, make a getUser.ts and updateUser.ts files
This files should have a function in each, getUser and updateUser.
These functions should call the appropriate endpoint as shown in quivr.

Then make a hook in the user folder called useUser. This should expose getUser and updateUser functions as done in Quivr.

@mattzcarey mattzcarey converted this from a draft issue Sep 4, 2023
@mattzcarey mattzcarey added this to the v2 - SaaS platform milestone Sep 4, 2023
@mattzcarey mattzcarey changed the title [Auth BE] AANext JS Backend I am authenticated with the core api [Auth BE] AAUser I can access the unauthenticated Apigateway endpoints from the frontend using a Next API proxy route Sep 4, 2023
@SEBRATHEZEBRA
Copy link
Contributor

Image

@SEBRATHEZEBRA SEBRATHEZEBRA linked a pull request Sep 5, 2023 that will close this issue
@SEBRATHEZEBRA SEBRATHEZEBRA moved this from In Progress to Code Review in Code Review GPT Roadmap Sep 5, 2023
@mattzcarey mattzcarey moved this from Code Review to Functional Review in Code Review GPT Roadmap Sep 7, 2023
@mattzcarey mattzcarey moved this from Functional Review to To Validate in Code Review GPT Roadmap Sep 7, 2023
@aiden-walton aiden-walton moved this from To Validate to Done in Code Review GPT Roadmap Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants