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

Remove signInAnonymously from authenticated API routes #187

Open
tinyherocarrot opened this issue Jun 14, 2023 · 0 comments
Open

Remove signInAnonymously from authenticated API routes #187

tinyherocarrot opened this issue Jun 14, 2023 · 0 comments
Labels
simple Won't take too much effort to fix!

Comments

@tinyherocarrot
Copy link
Collaborator

tinyherocarrot commented Jun 14, 2023

For some reason signInAnonymously needs to be called before each authenticated API route. We should find some way to eliminate this step

Motivation

Anonymous sign in causes a bunch of anonymous users in the user list. Also a ding on performance.

Problem

The server/backend doesnt know about authentication state on the client side, probably because API routes are built before the active session is retrieved. I can pass in the 'auth' object from middleware, but 'auth' object still won't be passed along to the firebase req (ie. update)

Approaches

@tinyherocarrot tinyherocarrot added the simple Won't take too much effort to fix! label Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simple Won't take too much effort to fix!
Projects
None yet
Development

No branches or pull requests

1 participant