adrien2p / medusa-plugins

A collection of awesome plugins for medusa :rocket:
https://medusa-plugins.vercel.app
MIT License
161 stars 46 forks source link

Firebase Auth - Unauthorized #116

Closed hampusboas closed 12 months ago

hampusboas commented 12 months ago

Hi,

I am using the Firebase Auth Method for the store auth but when i try to auth from the store i'm getting the response "Unauthorized" I'm passing my accessToken from the auth.currentUser.getIdToken() method in the Authorization header.

I've generated the firebase credentials Json from the "service accounts" tab in firebase console.

My medusa config looks like this.

{ resolve: "medusa-plugin-auth", /** @type {import('medusa-plugin-auth').AuthOptions} */ options: { strict: "store", firebase: { credentialJsonPath: CredentialJsonPath, store: { authPath: "/store/auth/firebase", expiresIn: 24 * 60 * 60 * 1000, }, }, }, },

I've tried with the absolute path or relative path to the firebase credentials file.

Best regards Hampus

hampusboas commented 12 months ago

After some debugging if a user already has a account created through medusa this method cannot be used! Feature Request: Allow users to merge accounts if the have the same email address.