-2

I am following the official firebase docs to do authentication in fresh. https://firebase.google.com/docs/auth But it's just not working.

Is there some docs, article, or blog that can guide me to implement this.

1 Answers1

0

I don't think firebase fully supports partial hydration or island Architecture.

So, you have to do authentication on the server side and preserve the user session state across page routes.

It will be tricky to do as fresh is new and the community is growing so not many articles that address this specific topic.

Not sure if it will work but try the below steps.

deno install -A https://deno.land/x/firebase_admin@v0.6.0/mod.ts

Now you can import the Firebase Admin SDK in your Deno Fresh application and initialize it with your Firebase project's credentials:

import * as admin from "https://deno.land/x/firebase_admin@v0.6.0/mod.ts";

const firebaseConfig = {
  // your Firebase project's configuration
};

admin.initializeApp(firebaseConfig);

and finally

const { user } = await admin.auth().createUserWithEmailAndPassword(email, password);
Akshat Tamrakar
  • 2,193
  • 2
  • 13
  • 21