Skip to content

[@firebase-auth] 501 Not Implement #1834

Description

@blackmouse572

Which middleware has the bug?

@hono/firebase

What version of the middleware?

^1.4.2

What version of Hono are you using?

^4.12.9

What runtime/platform is your app running on? (with version if possible)

Cloudflare worker

What steps can reproduce the bug?

  1. BACKEND SETUP
import { Hono } from 'hono'
import { cors } from 'hono/cors'
import { gallaryController } from './modules/gallery/gallery.controller'
import { verifyFirebaseAuth, VerifyFirebaseAuthEnv } from '@hono/firebase-auth'

type AppEnv = {
  Bindings: VerifyFirebaseAuthEnv
}
const app = new Hono<AppEnv>().basePath('/api')

app.use(
  '*',
  cors({
    origin: ['http://localhost:1420', 'tauri://localhost'],
    allowMethods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],
    allowHeaders: ['Content-Type', 'Authorization'],
    credentials: true,
  }),
)
app.use(
  '*',
  verifyFirebaseAuth({
    projectId: 'dev-something',
  }),
)
app.route('/gallery', gallaryController)

export default app
  1. FRONTEND SETUP
import { auth } from '@/firebase'
import axios from 'axios'

export const backendInstance = axios.create({
  baseURL: import.meta.env.VITE_BACKEND_URL || 'http://localhost:8080/api',
})

backendInstance.interceptors.request.use(async (config) => {
  if (!auth.currentUser) {
    return config
  }
  const idToken = await auth.currentUser.getIdToken()
  config.headers['Authorization'] = `Bearer ${idToken}`
  return config
})

function signUploadUrl() {
  return backendInstance.get('/gallery')
}

export const galleryService = {
  signUploadUrl,
}

What is the expected behavior?

Expect to got 200 OK with json response

What do you see instead?

501 Not Implemented

Image

Additional information

I use wrangler dev --local for runing backend

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions