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

Firebase Auth Middleware #26

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Firebase Auth Middleware #26

wants to merge 4 commits into from

Conversation

SaazM
Copy link

@SaazM SaazM commented Jan 16, 2025

Resolves #3

Added Firebase auth validator that checks if a valid token is in request header and either:
a) Retrieves user from firebase and adds it to request body if valid token is in the header.
b) Throws an error

To do this I also created the firebase initialization in utils.

Note - Now requires updated .env with service key, I will upload this to the google drive

Tested it by creating a token using the test user in the firebase auth using a python script I made(not in the push)

Example of successful token:
Screenshot 2025-01-15 at 9 58 24 PM

Example of invalid token:
Screenshot 2025-01-15 at 9 58 39 PM

Example of Token not in header:
Screenshot 2025-01-15 at 9 58 56 PM

@SaazM SaazM requested a review from mraysu as a code owner January 16, 2025 06:42
@SaazM SaazM requested a review from westonz7042 January 23, 2025 00:41
Copy link
Collaborator

@mraysu mraysu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

Copy link
Contributor

@westonz7042 westonz7042 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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 this pull request may close these issues.

[MISC] Firebase Auth Middleware
3 participants