I'm attempting to use firebase hosting to limit the download of a file (any file in a specific folder really) only to authenticated users. I've solved the problem for myself with a node server by following the firebase docs and writing a fireBaseAuth middleware, integrating with firebase storage, using google cloud storage, etc.
In order to deploy all this to firebase it looks like I would have to
- Setup firebase hosting with all my static files
- Upload the 'secure' files to firebase storage (what I'm doing now)
- Use firebase functions to parse request cookies and pluck files out of storage for authenticated users (what I'm doing with an express server now)
It seems like there should be a simpler solution for locking down routes within hosting - Am I missing something?
What I think should be possible:
- Upload all files to firebase hosting, including 'secure' files
- Tell firebase to only serve 'secure' files to authenticated users, maybe with a glob pattern
- Go home early...
Any ideas? If I'm not missing something and you're on the firebase team, then this is a feature request.
via Alan L.
No comments:
Post a Comment