Skip to content

Compatibility when hosting via Firebase Functions #24

@benjaminben

Description

@benjaminben

Thanks so much for this very helpful example repo. I wanted to leave a note here (since it was where I initially searched for the solution) that the cookie name token is not compatible as of writing with Firebase's experimental support for turnkey Next.js deployments. This is because Firebase Functions only accept one cookie by the name of __session. (SO source) While the example provided in this repo worked fine in development, the call to firebaseAdmin.auth().verifyIdToken(cookies.token) would fail in production due to Firebase stripping the token cookie. I switched the saved cookie's name to __session in both the AuthProvider and in authenticated.tsx and that resolved the issue for me, not sure if there are any potential pitfalls of doing this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions