Phase 1 scaffold: auth for all apps
- Backend: Fastify with two listeners (public + internal), routes, services, DB migration + seed - client_app: Flutter with BLoC, all auth screens (welcome, display name, register, OTP, force-register) - mitra_app: Flutter with BLoC, OTP-only login - control_center: React + Vite, email/password login, mitra/user management, anonymity settings - Docs: phase1 plan, API contract, client app mockup - CLAUDE.md and shared memory for all subprojects Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
19
backend/src/plugins/firebase.js
Normal file
19
backend/src/plugins/firebase.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import admin from 'firebase-admin'
|
||||
|
||||
let initialized = false
|
||||
|
||||
export const initFirebase = () => {
|
||||
if (initialized) return
|
||||
admin.initializeApp({
|
||||
credential: admin.credential.cert({
|
||||
projectId: process.env.FIREBASE_PROJECT_ID,
|
||||
clientEmail: process.env.FIREBASE_CLIENT_EMAIL,
|
||||
privateKey: process.env.FIREBASE_PRIVATE_KEY?.replace(/\\n/g, '\n'),
|
||||
}),
|
||||
})
|
||||
initialized = true
|
||||
}
|
||||
|
||||
export const verifyFirebaseToken = async (token) => {
|
||||
return admin.auth().verifyIdToken(token)
|
||||
}
|
||||
Reference in New Issue
Block a user