Code-Hex / firebase-auth-cloudflare-workers

https://www.npmjs.com/package/firebase-auth-cloudflare-workers
MIT License
129 stars 4 forks source link

createCustomToken #22

Open danjenkins opened 1 month ago

danjenkins commented 1 month ago

I see createCustomToken in the tests... but I see its within a test util file.

What would it take to make createCustomToken an actual callable function within the module itself? I looked but got confused due to the emulator use etc.

danjenkins commented 1 month ago

I see in the nextjs auth middleware they have similar functionality

https://github.com/awinogrodzki/next-firebase-auth-edge/blob/2d83441a9aa9f1ccaf15109ee69997bb2eddc605/src/auth/token-generator.ts#L40

With a crypto signer here - https://github.com/awinogrodzki/next-firebase-auth-edge/blob/2d83441a9aa9f1ccaf15109ee69997bb2eddc605/src/auth/jwt/crypto-signer.ts

But more specifically a service account signer

https://github.com/awinogrodzki/next-firebase-auth-edge/blob/2d83441a9aa9f1ccaf15109ee69997bb2eddc605/src/auth/jwt/crypto-signer.ts#L12C14-L12C34