Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function getAuth().generatePasswordResetLink(...) does not display a reset password screen on the emulator #8185

Open
G-Cyrille opened this issue Feb 7, 2025 · 2 comments

Comments

@G-Cyrille
Copy link

[REQUIRED] Environment info

firebase-tools: 13.20.0

Platform: MacOS : Sequoia 15.3

[REQUIRED] Test case

I don't have a reproduction project, steps to reproduce are bellow.

[REQUIRED] Steps to reproduce

  1. Start a blank firebase function project
  2. Start emulators
  3. Write a function :
export const creationAuth = auth.user().onCreate(async (user) => {
  console.log('New user created:', user.uid)

  const email = user.email
  if (!email) {
    logger.error('user created without email')
    return
  }

  const verificationLink = await getAuth().generatePasswordResetLink(email, {
    url: (process.env.REGISTER_REDIRECT_URL || 'http://localhost:5007') + '?email=' + email,
  })
  logger.info(verificationLink)

  // do something with verificationLink
  // await sendEmailWelcomeEmail(verificationLink)
})
  1. Create a user in the simulator
  2. Check simulator logs for the created link
  3. paste the link on firefox
    mine for example : http://127.0.0.1:9099/emulator/action?mode=resetPassword&lang=en&oobCode=REDACTED&apiKey=fake-api-key&continueUrl=http%3A%2F%2Flocalhost%3A5007%2Flogin
  4. Receive a JSON like :
{
  "authEmulator": {
    "error": "missing newPassword query parameter",
    "instructions": "To reset the password for [email protected], send an HTTP GET request to the following URL.",
    "instructions2": "You may use a web browser or any HTTP client, such as curl.",
    "urlTemplate": "http://127.0.0.1:9099/emulator/action?mode=resetPassword&lang=en&oobCode=REDACTED&apiKey=fake-api-key&continueUrl=http%3A%2F%2Flocalhost%3A5007%2Flogin&newPassword=NEW_PASSWORD_HERE"
  }
}

NB : this seems to be a bug for quite a while:
https://stackoverflow.com/questions/72435063/how-to-generate-password-reset-link-through-cloud-functions

[REQUIRED] Expected behavior

On step 7, the emulator should display the default "reset password screen".

[REQUIRED] Actual behavior

Error described as a JSON error in the browser

log during link creation (nb : there might be some more logs as this is a part of a bigger project) :

[api] [2025-02-07T17:34:05.524Z] >>> [apiv2][query] POST http://127.0.0.1:5001/functions/projects/koolookoo-staging/trigger_multicast [none]
[api] [2025-02-07T17:34:05.525Z] >>> [apiv2][body] POST http://127.0.0.1:5001/functions/projects/koolookoo-staging/trigger_multicast {"eventId":"a89c1c9b-467d-4df5-979d-8e15dfce8139","eventType":"providers/firebase.auth/eventTypes/user.create","resource":{"name":"projects/koolookoo-staging","service":"firebaseauth.googleapis.com"},"params":{},"timestamp":"2025-02-07T17:34:05.523Z","data":{"uid":"FDrComfJ9p6QhluAt15fslYm2W53","email":"[email protected]","emailVerified":false,"metadata":{"creationTime":"2025-02-07T17:34:05.522Z","lastSignInTime":"2025-02-07T17:34:05.522Z"},"customClaims":{},"providerData":[{"providerId":"password","email":"[email protected]","federatedId":"[email protected]","rawId":"[email protected]"}]}}
[api] [2025-02-07T17:34:05.540Z] [work-queue] {"queuedWork":["us-central1-auto-trigger-creationAuth-0-2025-02-07T17:34:05.540Z"],"queueLength":1,"runningWork":[],"workRunningCount":0}
[api] [2025-02-07T17:34:05.543Z] [work-queue] {"queuedWork":[],"queueLength":0,"runningWork":["us-central1-auto-trigger-creationAuth-0-2025-02-07T17:34:05.540Z"],"workRunningCount":1}
[api] [2025-02-07T17:34:05.544Z] [work-queue] {"queuedWork":[],"queueLength":0,"runningWork":[],"workRunningCount":0}
[api] [2025-02-07T17:34:05.545Z] <<< [apiv2][status] POST http://127.0.0.1:5001/functions/projects/koolookoo-staging/trigger_multicast 200
[api] [2025-02-07T17:34:05.545Z] <<< [apiv2][body] POST http://127.0.0.1:5001/functions/projects/koolookoo-staging/trigger_multicast {"status":"multicast_acknowledged"}
[api] [2025-02-07T17:34:05.552Z] [work-queue] {"queuedWork":["/functions/projects/koolookoo-staging/triggers/us-central1-auto-trigger-creationAuth-0-2025-02-07T17:34:05.551Z"],"queueLength":1,"runningWork":[],"workRunningCount":0}
[api] [2025-02-07T17:34:05.552Z] [work-queue] {"queuedWork":[],"queueLength":0,"runningWork":["/functions/projects/koolookoo-staging/triggers/us-central1-auto-trigger-creationAuth-0-2025-02-07T17:34:05.551Z"],"workRunningCount":1}
[api] [2025-02-07T17:34:05.552Z] Accepted request POST /functions/projects/koolookoo-staging/triggers/us-central1-auto-trigger-creationAuth-0 --> us-central1-auto-trigger-creationAuth-0
[api] [2025-02-07T17:34:05.557Z] [functions] Runtime ready! Sending request! {"metadata":{"emulator":{"name":"functions"},"message":"[functions] Runtime ready! Sending request!"}}
[api] [2025-02-07T17:34:05.558Z] [functions] Got req.url=/functions/projects/koolookoo-staging/triggers/us-central1-auto-trigger-creationAuth-0, mapping to path=/functions/projects/ {"metadata":{"emulator":{"name":"functions"},"message":"[functions] Got req.url=/functions/projects/koolookoo-staging/triggers/us-central1-auto-trigger-creationAuth-0, mapping to path=/functions/projects/"}}
[api] i  functions: Loaded environment variables from .env.koolookoo-staging, .env.local. 
[api] [2025-02-07T17:34:05.583Z] [worker-pool] addWorker(us-central1-auto-trigger-creationAuth) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(us-central1-auto-trigger-creationAuth)"}}
[api] [2025-02-07T17:34:05.588Z] [worker-pool] Adding worker with key us-central1-auto-trigger-creationAuth, total=1 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key us-central1-auto-trigger-creationAuth, total=1"}}
[api] [2025-02-07T17:34:05.614Z] Feb 07, 2025 6:34:05 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
[api] INFO: Detected non-HTTP/2 connection.
[api] Feb 07, 2025 6:34:05 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
[api] INFO: Detected non-HTTP/2 connection.
[api]  {"metadata":{"emulator":{"name":"firestore"},"message":"Feb 07, 2025 6:34:05 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\nFeb 07, 2025 6:34:05 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[api] [2025-02-07T17:34:05.643Z] Feb 07, 2025 6:34:05 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
[api] INFO: Detected non-HTTP/2 connection.
[api]  {"metadata":{"emulator":{"name":"firestore"},"message":"Feb 07, 2025 6:34:05 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[api] [2025-02-07T17:34:05.954Z] Feb 07, 2025 6:34:05 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
[api] INFO: Detected non-HTTP/2 connection.
[api]  {"metadata":{"emulator":{"name":"firestore"},"message":"Feb 07, 2025 6:34:05 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[api] [2025-02-07T17:34:06.797Z] [runtime-status] [51065] Resolved module firebase-admin {"declared":true,"installed":true,"version":"12.7.0","resolution":"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"12.7.0\",\"resolution\":\"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[api] [2025-02-07T17:34:06.797Z] [runtime-status] [51065] Resolved module firebase-functions {"declared":true,"installed":true,"version":"6.3.1","resolution":"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-functions/lib/v2/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"6.3.1\",\"resolution\":\"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-functions/lib/v2/index.js\"}"}}
[api] [2025-02-07T17:34:06.798Z] [runtime-status] [51065] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}] {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] Outgoing network have been stubbed. [{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"net\",\"status\":\"mocked\"}]"}}
[api] [2025-02-07T17:34:06.798Z] [runtime-status] [51065] Resolved module firebase-functions {"declared":true,"installed":true,"version":"6.3.1","resolution":"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-functions/lib/v2/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"6.3.1\",\"resolution\":\"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-functions/lib/v2/index.js\"}"}}
[api] [2025-02-07T17:34:06.984Z] [runtime-status] [51065] Checked functions.config() {"config":{}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] Checked functions.config() {\"config\":{}}"}}
[api] [2025-02-07T17:34:06.984Z] [runtime-status] [51065] firebase-functions has been stubbed. {"functionsResolution":{"declared":true,"installed":true,"version":"6.3.1","resolution":"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-functions/lib/v2/index.js"}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] firebase-functions has been stubbed. {\"functionsResolution\":{\"declared\":true,\"installed\":true,\"version\":\"6.3.1\",\"resolution\":\"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-functions/lib/v2/index.js\"}}"}}
[api] [2025-02-07T17:34:06.984Z] [runtime-status] [51065] Resolved module firebase-functions {"declared":true,"installed":true,"version":"6.3.1","resolution":"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-functions/lib/v2/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"6.3.1\",\"resolution\":\"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-functions/lib/v2/index.js\"}"}}
[api] [2025-02-07T17:34:06.987Z] [runtime-status] [51065] Resolved module firebase-admin {"declared":true,"installed":true,"version":"12.7.0","resolution":"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"12.7.0\",\"resolution\":\"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[api] [2025-02-07T17:34:06.988Z] [runtime-status] [51065] Resolved module firebase-functions {"declared":true,"installed":true,"version":"6.3.1","resolution":"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-functions/lib/v2/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"6.3.1\",\"resolution\":\"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-functions/lib/v2/index.js\"}"}}
[api] [2025-02-07T17:34:06.988Z] [runtime-status] [51065] firebase-admin has been stubbed. {"adminResolution":{"declared":true,"installed":true,"version":"12.7.0","resolution":"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-admin/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] firebase-admin has been stubbed. {\"adminResolution\":{\"declared\":true,\"installed\":true,\"version\":\"12.7.0\",\"resolution\":\"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions/node_modules/firebase-admin/lib/index.js\"}}"}}
[api] [2025-02-07T17:34:07.387Z] [runtime-status] [51065] Functions runtime initialized. {"cwd":"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions","node_version":"20.17.0"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] Functions runtime initialized. {\"cwd\":\"/Users/cyrillegrossholtz/Documents/dev/koolookoo/functions\",\"node_version\":\"20.17.0\"}"}}
[api] [2025-02-07T17:34:07.388Z] [runtime-status] [51065] Listening to port: /var/folders/mx/wxmn856d0754znpxj4ljb24c0000gn/T/fire_emu_e7d147a48ff23139.sock {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] Listening to port: /var/folders/mx/wxmn856d0754znpxj4ljb24c0000gn/T/fire_emu_e7d147a48ff23139.sock"}}
[api] [2025-02-07T17:34:07.423Z] [worker-us-central1-auto-trigger-creationAuth-f2343f5c-bc64-43fd-8af8-2ababd21e0f7]: IDLE {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[worker-us-central1-auto-trigger-creationAuth-f2343f5c-bc64-43fd-8af8-2ababd21e0f7]: IDLE"}}
[api] [2025-02-07T17:34:07.424Z] [worker-pool] submitRequest(triggerId=us-central1-auto-trigger-creationAuth) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitRequest(triggerId=us-central1-auto-trigger-creationAuth)"}}
[api] i  functions: Beginning execution of "us-central1-auto-trigger-creationAuth" {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"Beginning execution of \"us-central1-auto-trigger-creationAuth\""}}
[api] [2025-02-07T17:34:07.424Z] [worker-us-central1-auto-trigger-creationAuth-f2343f5c-bc64-43fd-8af8-2ababd21e0f7]: BUSY {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[worker-us-central1-auto-trigger-creationAuth-f2343f5c-bc64-43fd-8af8-2ababd21e0f7]: BUSY"}}
[api] [2025-02-07T17:34:07.434Z] [runtime-status] [51065] ProcessBackground: lifting resource.name from resource {"name":"projects/koolookoo-staging","service":"firebaseauth.googleapis.com"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] ProcessBackground: lifting resource.name from resource {\"name\":\"projects/koolookoo-staging\",\"service\":\"firebaseauth.googleapis.com\"}"}}
[api] [2025-02-07T17:34:07.434Z] [runtime-status] [51065] RunBackground {"data":{"uid":"FDrComfJ9p6QhluAt15fslYm2W53","email":"[email protected]","emailVerified":false,"metadata":{"creationTime":"2025-02-07T17:34:05.522Z","lastSignInTime":"2025-02-07T17:34:05.522Z"},"customClaims":{},"providerData":[{"providerId":"password","email":"[email protected]","federatedId":"[email protected]","rawId":"[email protected]"}]},"context":{"eventId":"a89c1c9b-467d-4df5-979d-8e15dfce8139","eventType":"providers/firebase.auth/eventTypes/user.create","resource":"projects/koolookoo-staging","params":{},"timestamp":"2025-02-07T17:34:05.523Z"}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[runtime-status] [51065] RunBackground {\"data\":{\"uid\":\"FDrComfJ9p6QhluAt15fslYm2W53\",\"email\":\"[email protected]\",\"emailVerified\":false,\"metadata\":{\"creationTime\":\"2025-02-07T17:34:05.522Z\",\"lastSignInTime\":\"2025-02-07T17:34:05.522Z\"},\"customClaims\":{},\"providerData\":[{\"providerId\":\"password\",\"email\":\"[email protected]\",\"federatedId\":\"[email protected]\",\"rawId\":\"[email protected]\"}]},\"context\":{\"eventId\":\"a89c1c9b-467d-4df5-979d-8e15dfce8139\",\"eventType\":\"providers/firebase.auth/eventTypes/user.create\",\"resource\":\"projects/koolookoo-staging\",\"params\":{},\"timestamp\":\"2025-02-07T17:34:05.523Z\"}}"}}
[api] >  New user created: FDrComfJ9p6QhluAt15fslYm2W53 {"user":"New user created: FDrComfJ9p6QhluAt15fslYm2W53","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m New user created: FDrComfJ9p6QhluAt15fslYm2W53"}}
[api] >  {"severity":"INFO","message":"c3g"} {"user":{"severity":"INFO","message":"c3g"},"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m {\"severity\":\"INFO\",\"message\":\"c3g\"}"}}
[api] [2025-02-07T17:34:07.709Z] Feb 07, 2025 6:34:07 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
[api] INFO: Detected HTTP/2 connection.
[api]  {"metadata":{"emulator":{"name":"firestore"},"message":"Feb 07, 2025 6:34:07 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected HTTP/2 connection.\n"}}
[api] >  {"severity":"INFO","message":"http://127.0.0.1:9099/emulator/action?mode=resetPassword&lang=en&oobCode=OIxfuMvHW2OCcZCoM3I_Ot_tmVjyCPxZZ9S_BM5ESr_hiKyTjNjrDu&apiKey=fake-api-key&continueUrl=http%3A%2F%2Flocalhost%3A5007%2Flogin%3Femail%3Dc3g%40grossholtz.net"} {"user":{"severity":"INFO","message":"http://127.0.0.1:9099/emulator/action?mode=resetPassword&lang=en&oobCode=OIxfuMvHW2OCcZCoM3I_Ot_tmVjyCPxZZ9S_BM5ESr_hiKyTjNjrDu&apiKey=fake-api-key&continueUrl=http%3A%2F%2Flocalhost%3A5007%2Flogin%3Femail%3Dc3g%40grossholtz.net"},"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m {\"severity\":\"INFO\",\"message\":\"http://127.0.0.1:9099/emulator/action?mode=resetPassword&lang=en&oobCode=OIxfuMvHW2OCcZCoM3I_Ot_tmVjyCPxZZ9S_BM5ESr_hiKyTjNjrDu&apiKey=fake-api-key&continueUrl=http%3A%2F%2Flocalhost%3A5007%2Flogin%3Femail%3Dc3g%40grossholtz.net\"}"}}
[api] >  [id=email-mwhm37xlv]Sending email [welcome] to [email protected] with subject "Bienvenue chez Koolookoo 👋" {"user":"[id=email-mwhm37xlv]Sending email [welcome] to [email protected] with subject \"Bienvenue chez Koolookoo 👋\"","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m [id=email-mwhm37xlv]Sending email [welcome] to [email protected] with subject \"Bienvenue chez Koolookoo 👋\""}}
[api] [2025-02-07T17:34:07.776Z] Finishing up request with event=pause {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"Finishing up request with event=pause"}}
[api] i  functions: Finished "us-central1-auto-trigger-creationAuth" in 352.279375ms {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"Finished \"us-central1-auto-trigger-creationAuth\" in 352.279375ms"}}
[api] [2025-02-07T17:34:07.777Z] [worker-us-central1-auto-trigger-creationAuth-f2343f5c-bc64-43fd-8af8-2ababd21e0f7]: IDLE {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"[worker-us-central1-auto-trigger-creationAuth-f2343f5c-bc64-43fd-8af8-2ababd21e0f7]: IDLE"}}
[api] [2025-02-07T17:34:07.777Z] Finishing up request with event=finish {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"Finishing up request with event=finish"}}
[api] [2025-02-07T17:34:07.777Z] Finishing up request with event=close {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"Finishing up request with event=close"}}
[api] [2025-02-07T17:34:07.777Z] [work-queue] {"queuedWork":[],"queueLength":0,"runningWork":[],"workRunningCount":0}
[api] >  [id=email-mwhm37xlv]MESSAGE :  { {"user":"[id=email-mwhm37xlv]MESSAGE :  {","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m [id=email-mwhm37xlv]MESSAGE :  {"}}
[api] >    accepted: [ '[email protected]' ], {"user":"  accepted: [ \u001b[32m'[email protected]'\u001b[39m ],","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m   accepted: [ \u001b[32m'[email protected]'\u001b[39m ],"}}
[api] >    rejected: [], {"user":"  rejected: [],","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m   rejected: [],"}}
[api] >    ehlo: [ {"user":"  ehlo: [","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m   ehlo: ["}}
[api] >      'PIPELINING', {"user":"    \u001b[32m'PIPELINING'\u001b[39m,","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m     \u001b[32m'PIPELINING'\u001b[39m,"}}
[api] >      '8BITMIME', {"user":"    \u001b[32m'8BITMIME'\u001b[39m,","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m     \u001b[32m'8BITMIME'\u001b[39m,"}}
[api] >      'ENHANCEDSTATUSCODES', {"user":"    \u001b[32m'ENHANCEDSTATUSCODES'\u001b[39m,","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m     \u001b[32m'ENHANCEDSTATUSCODES'\u001b[39m,"}}
[api] >      'CHUNKING', {"user":"    \u001b[32m'CHUNKING'\u001b[39m,","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m     \u001b[32m'CHUNKING'\u001b[39m,"}}
[api] >      'AUTH CRAM-MD5 PLAIN LOGIN', {"user":"    \u001b[32m'AUTH CRAM-MD5 PLAIN LOGIN'\u001b[39m,","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m     \u001b[32m'AUTH CRAM-MD5 PLAIN LOGIN'\u001b[39m,"}}
[api] >      'SIZE 20971520' {"user":"    \u001b[32m'SIZE 20971520'\u001b[39m","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m     \u001b[32m'SIZE 20971520'\u001b[39m"}}
[api] >    ], {"user":"  ],","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m   ],"}}
[api] >    envelopeTime: 80, {"user":"  envelopeTime: \u001b[33m80\u001b[39m,","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m   envelopeTime: \u001b[33m80\u001b[39m,"}}
[api] >    messageTime: 84, {"user":"  messageTime: \u001b[33m84\u001b[39m,","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m   messageTime: \u001b[33m84\u001b[39m,"}}
[api] >    messageSize: 27114, {"user":"  messageSize: \u001b[33m27114\u001b[39m,","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m   messageSize: \u001b[33m27114\u001b[39m,"}}
[api] >    response: '250 2.0.0 OK: queued as <[email protected]>', {"user":"  response: \u001b[32m'250 2.0.0 OK: queued as <[email protected]>'\u001b[39m,","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m   response: \u001b[32m'250 2.0.0 OK: queued as <[email protected]>'\u001b[39m,"}}
[api] >    envelope: { from: '[email protected]', to: [ '[email protected]' ] }, {"user":"  envelope: { from: \u001b[32m'[email protected]'\u001b[39m, to: [ \u001b[32m'[email protected]'\u001b[39m ] },","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m   envelope: { from: \u001b[32m'[email protected]'\u001b[39m, to: [ \u001b[32m'[email protected]'\u001b[39m ] },"}}
[api] >    messageId: '<[email protected]>' {"user":"  messageId: \u001b[32m'<[email protected]>'\u001b[39m","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m   messageId: \u001b[32m'<[email protected]>'\u001b[39m"}}
[api] >  } {"user":"}","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-auto-trigger-creationAuth"},"extension":{},"message":"\u001b[90m> \u001b[39m }"}}
[api] [2025-02-07T17:35:06.035Z] Feb 07, 2025 6:35:06 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
[api] INFO: Detected non-HTTP/2 connection.
[api]  {"metadata":{"emulator":{"name":"firestore"},"message":"Feb 07, 2025 6:35:06 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}

log during click on the link

no log

NB : it works on production environment, it is a emulator-only issue.

@aalej
Copy link
Contributor

aalej commented Feb 12, 2025

Hey @G-Cyrille, thanks for the detailed report! Let me know if I may have misunderstood, but from what I can gather, the issue here is that the emulator displays a JSON response instead of a webpage for resetting passwords.

Currently, for resetting passwords on the Auth emulator, you will need to input the new password using the provided link in the JSON response, such as:

http://localhost:9099/emulator/action?mode=resetPassword&oobCode=xxxxxxx&apiKey=yyyyyy&newPassword=YOUR_NEW_PASSWORD 

Having JSON responses instead of UI widgets makes it easier to perform automated tests without the use of headless browsers, fake DOM API, etc. to interact with a web page.

Though I do see how matching production behavior of displaying a webpage would be useful as it would imitate the production behavior of Auth. For now, I’ll mark this as a feature request for supporting UI widgets when resetting passwords.

@aalej aalej changed the title function getAuth().generatePasswordResetLink(...) does not work on emulator function getAuth().generatePasswordResetLink(...) does not display a reset password screen on the emulator Feb 12, 2025
@G-Cyrille
Copy link
Author

Yes, you understand perfectly !

I would add that having some sort of mechanism to customize Action URL in the emulator would be amazing !

Action URL (%LINK% value) customizaton in the production environment like:

Image

The default value would be http://localhost:9099/emulator/action in order to keep the current usage, but allowing anyone to test other scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants