firebase / firebase-tools

The Firebase Command Line Tools
MIT License
3.97k stars 917 forks source link

Emulator doesn't print URL for email verification for newly created auth accounts #2906

Open TaylorFacen opened 3 years ago

TaylorFacen commented 3 years ago

[REQUIRED] Environment info

firebase version 8.17.0

MacOS Big Sur 11.0.1

[REQUIRED] Test case

The documentation here says

"For testing email verification/sign-in with email link flows, the emulator prints a URL to the terminal at which firebase emulators:start was executed."

However, when creating a user via the auth emulator or via the web app client, no URL is printed to the terminal. The user is created in auth emulator.

[REQUIRED] Steps to reproduce

Run in terminal export FIRESTORE_EMULATOR_HOST="localhost:8080" export FIREBASE_AUTH_EMULATOR_HOST="localhost:9099"

The run firebase emulators:start

[REQUIRED] Expected behavior

I expect the links to be printed in the terminal as stated by the documentation.

[REQUIRED] Actual behavior

No links are printed and I have no way to simulate email verification for the test user.

As a note, I tried having the host URLs without the quotes in my environment which didn't work either. export FIRESTORE_EMULATOR_HOST=localhost:8080 export FIREBASE_AUTH_EMULATOR_HOST=localhost:9099

firebase-debug.log output

[debug] [2020-12-05T22:32:28.708Z] Command:       /usr/local/bin/node /usr/local/bin/firebase emulators:start
[debug] [2020-12-05T22:32:28.708Z] CLI Version:   8.17.0
[debug] [2020-12-05T22:32:28.708Z] Platform:      darwin
[debug] [2020-12-05T22:32:28.708Z] Node Version:  v12.18.3
[debug] [2020-12-05T22:32:28.709Z] Time:          Sat Dec 05 2020 17:32:28 GMT-0500 (Eastern Standard Time)
[debug] [2020-12-05T22:32:28.709Z] Env Overrides: FIRESTORE_EMULATOR_HOST
[debug] [2020-12-05T22:32:28.709Z] ----------------------------------------------------------------------
[debug] [2020-12-05T22:32:28.709Z] 
[debug] [2020-12-05T22:32:28.718Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-12-05T22:32:28.719Z] > authorizing via signed-in user
[info] i  emulators: Starting emulators: auth, functions, firestore, hosting {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: auth, functions, firestore, hosting"}}
[debug] [2020-12-05T22:32:28.738Z] [hub] writing locator at /var/folders/_6/mthrfkqx6mzgjsw22v07pfwh0000gn/T/hub-finta-app.json
[warn] ⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: database, pubsub {"metadata":{"emulator":{"name":"functions"},"message":"The following emulators are not running, calls to these services from the Functions emulator will affect production: \u001b[1mdatabase, pubsub\u001b[22m"}}
[warn] ⚠  Your requested "node" version "10" doesn't match your global version "12" {"metadata":{"emulator":{"name":"functions"},"message":"Your requested \"node\" version \"10\" doesn't match your global version \"12\""}}
[debug] [2020-12-05T22:32:28.775Z] defaultcredentials: writing to file /Users/taylor/.config/firebase/taylor_facen_gmail.com_application_default_credentials.json
[debug] [2020-12-05T22:32:28.778Z] Setting GAC to /Users/taylor/.config/firebase/taylor_facen_gmail.com_application_default_credentials.json {"metadata":{"emulator":{"name":"functions"},"message":"Setting GAC to /Users/taylor/.config/firebase/taylor_facen_gmail.com_application_default_credentials.json"}}
[debug] [2020-12-05T22:32:29.042Z] Ignoring unsupported arg: projectId {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: projectId"}}
[debug] [2020-12-05T22:32:29.042Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: auto_download"}}
[debug] [2020-12-05T22:32:29.042Z] Starting Firestore Emulator with command {"binary":"java","args":["-Duser.language=en","-jar","/Users/taylor/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.9.jar","--host","localhost","--port",8080,"--rules","/Users/taylor/Projects/finta/firestore.rules","--functions_emulator","localhost:5001"],"optionalArgs":["port","webchannel_port","host","rules","functions_emulator","seed_from_export"],"joinArgs":false} {"metadata":{"emulator":{"name":"firestore"},"message":"Starting Firestore Emulator with command {\"binary\":\"java\",\"args\":[\"-Duser.language=en\",\"-jar\",\"/Users/taylor/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.9.jar\",\"--host\",\"localhost\",\"--port\",8080,\"--rules\",\"/Users/taylor/Projects/finta/firestore.rules\",\"--functions_emulator\",\"localhost:5001\"],\"optionalArgs\":[\"port\",\"webchannel_port\",\"host\",\"rules\",\"functions_emulator\",\"seed_from_export\"],\"joinArgs\":false}"}}
[info] i  firestore: Firestore Emulator logging to firestore-debug.log {"metadata":{"emulator":{"name":"firestore"},"message":"Firestore Emulator logging to \u001b[1mfirestore-debug.log\u001b[22m"}}
[debug] [2020-12-05T22:32:30.057Z] API endpoint: http://localhost: {"metadata":{"emulator":{"name":"firestore"},"message":"API endpoint: http://localhost:"}}
[debug] [2020-12-05T22:32:30.058Z] 8080
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:

   export FIRESTORE_EMULATOR_HOST=localhost:8080

Dev App Server is now running.

 {"metadata":{"emulator":{"name":"firestore"},"message":"8080\nIf you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:\n\n   export FIRESTORE_EMULATOR_HOST=localhost:8080\n\nDev App Server is now running.\n\n"}}
[debug] [2020-12-05T22:32:32.328Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/finta-app/webApps/-/config  

[debug] [2020-12-05T22:32:32.862Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 05 Dec 2020 22:32:32 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[info] i  hosting: Serving hosting files from: build {"metadata":{"emulator":{"name":"hosting"},"message":"Serving hosting files from: \u001b[1mbuild\u001b[22m"}}
[info] ✔  hosting: Local server: http://localhost:5000 {"metadata":{"emulator":{"name":"hosting"},"message":"Local server: \u001b[4m\u001b[1mhttp://localhost:5000\u001b[22m\u001b[24m"}}
[warn] ⚠  ui: Emulator UI unable to start on port 4000, starting on 4001 instead. {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI unable to start on port 4000, starting on 4001 instead."}}
[debug] [2020-12-05T22:32:33.205Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: auto_download"}}
[debug] [2020-12-05T22:32:33.205Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: port"}}
[debug] [2020-12-05T22:32:33.205Z] Starting Emulator UI with command {"binary":"node","args":["/Users/taylor/.cache/firebase/emulators/ui-v1.3.0/server.bundle.js"],"optionalArgs":[],"joinArgs":false} {"metadata":{"emulator":{"name":"ui"},"message":"Starting Emulator UI with command {\"binary\":\"node\",\"args\":[\"/Users/taylor/.cache/firebase/emulators/ui-v1.3.0/server.bundle.js\"],\"optionalArgs\":[],\"joinArgs\":false}"}}
[info] i  ui: Emulator UI logging to ui-debug.log {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI logging to \u001b[1mui-debug.log\u001b[22m"}}
[debug] [2020-12-05T22:32:33.296Z] Web / API server started at http://localhost:4001
 {"metadata":{"emulator":{"name":"ui"},"message":"Web / API server started at http://localhost:4001\n"}}
[info] i  functions: Watching "/Users/taylor/Projects/finta/functions" for Cloud Functions... {"metadata":{"emulator":{"name":"functions"},"message":"Watching \"/Users/taylor/Projects/finta/functions\" for Cloud Functions..."}}
[debug] [2020-12-05T22:32:33.488Z] [worker-pool] addWorker(~diagnostic~) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(~diagnostic~)"}}
[debug] [2020-12-05T22:32:33.488Z] [worker-pool] Adding worker with key ~diagnostic~, total=1 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key ~diagnostic~, total=1"}}
[debug] [2020-12-05T22:32:33.489Z] [worker-pool] submitWork(triggerId=) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitWork(triggerId=)"}}
[debug] [2020-12-05T22:32:33.489Z] [worker-~diagnostic~-4e38f491-edc5-4e54-a8b2-d6c15d233ad1]: Assigning socketPath: /var/folders/_6/mthrfkqx6mzgjsw22v07pfwh0000gn/T/fire_emu_56519.sock {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-4e38f491-edc5-4e54-a8b2-d6c15d233ad1]: Assigning socketPath: /var/folders/_6/mthrfkqx6mzgjsw22v07pfwh0000gn/T/fire_emu_56519.sock"}}
[debug] [2020-12-05T22:32:33.490Z] [worker-~diagnostic~-4e38f491-edc5-4e54-a8b2-d6c15d233ad1]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-4e38f491-edc5-4e54-a8b2-d6c15d233ad1]: BUSY"}}
[debug] [2020-12-05T22:32:33.626Z] [runtime-status] [56519] Functions runtime initialized. {"cwd":"/Users/taylor/Projects/finta/functions","node_version":"12.18.3"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] Functions runtime initialized. {\"cwd\":\"/Users/taylor/Projects/finta/functions\",\"node_version\":\"12.18.3\"}"}}
[debug] [2020-12-05T22:32:33.627Z] [runtime-status] [56519] Disabled runtime features: undefined {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] Disabled runtime features: undefined"}}
[debug] [2020-12-05T22:32:33.629Z] [runtime-status] [56519] Resolved module firebase-admin {"declared":true,"installed":true,"version":"9.4.1","resolution":"/Users/taylor/Projects/finta/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"9.4.1\",\"resolution\":\"/Users/taylor/Projects/finta/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[debug] [2020-12-05T22:32:33.632Z] [runtime-status] [56519] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.12.0","resolution":"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.12.0\",\"resolution\":\"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2020-12-05T22:32:33.633Z] [runtime-status] [56519] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.12.0","resolution":"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.12.0\",\"resolution\":\"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2020-12-05T22:32:33.634Z] [runtime-status] [56519] 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"},"message":"[runtime-status] [56519] 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\"}]"}}
[debug] [2020-12-05T22:32:33.635Z] [runtime-status] [56519] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.12.0","resolution":"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.12.0\",\"resolution\":\"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2020-12-05T22:32:33.701Z] [runtime-status] [56519] Checked functions.config() {"config":{}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] Checked functions.config() {\"config\":{}}"}}
[debug] [2020-12-05T22:32:33.701Z] [runtime-status] [56519] firebase-functions has been stubbed. {"functionsResolution":{"declared":true,"installed":true,"version":"3.12.0","resolution":"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] firebase-functions has been stubbed. {\"functionsResolution\":{\"declared\":true,\"installed\":true,\"version\":\"3.12.0\",\"resolution\":\"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js\"}}"}}
[debug] [2020-12-05T22:32:33.702Z] [runtime-status] [56519] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.12.0","resolution":"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.12.0\",\"resolution\":\"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2020-12-05T22:32:33.703Z] [runtime-status] [56519] Resolved module firebase-admin {"declared":true,"installed":true,"version":"9.4.1","resolution":"/Users/taylor/Projects/finta/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"9.4.1\",\"resolution\":\"/Users/taylor/Projects/finta/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[debug] [2020-12-05T22:32:33.704Z] [runtime-status] [56519] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.12.0","resolution":"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.12.0\",\"resolution\":\"/Users/taylor/Projects/finta/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2020-12-05T22:32:33.704Z] [runtime-status] [56519] firebase-admin has been stubbed. {"adminResolution":{"declared":true,"installed":true,"version":"9.4.1","resolution":"/Users/taylor/Projects/finta/functions/node_modules/firebase-admin/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] firebase-admin has been stubbed. {\"adminResolution\":{\"declared\":true,\"installed\":true,\"version\":\"9.4.1\",\"resolution\":\"/Users/taylor/Projects/finta/functions/node_modules/firebase-admin/lib/index.js\"}}"}}
[debug] [2020-12-05T22:32:33.706Z] [runtime-status] [56519] initializeApp(DEFAULT) {"databaseURL":"https://finta-app.firebaseio.com","storageBucket":"finta-app.appspot.com","projectId":"finta-app"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] initializeApp(DEFAULT) {\"databaseURL\":\"https://finta-app.firebaseio.com\",\"storageBucket\":\"finta-app.appspot.com\",\"projectId\":\"finta-app\"}"}}
[debug] [2020-12-05T22:32:33.787Z] [runtime-status] [56519] auth.setJwtVerificationEnabled(false) {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [56519] auth.setJwtVerificationEnabled(false)"}}
[debug] [2020-12-05T22:32:33.834Z] addFirestoreTrigger "{\"eventTrigger\":{\"resource\":\"projects/finta-app/databases/(default)/documents/users/{userId}\",\"eventType\":\"providers/cloud.firestore/eventTypes/document.create\",\"service\":\"firestore.googleapis.com\"}}"
[debug] [2020-12-05T22:32:33.834Z] >>> HTTP REQUEST PUT http://localhost:8080/emulator/v1/projects/finta-app/triggers/users-newUserActions-0  
 {"eventTrigger":{"resource":"projects/finta-app/databases/(default)/documents/users/{userId}","eventType":"providers/cloud.firestore/eventTypes/document.create","service":"firestore.googleapis.com"}}
[debug] [2020-12-05T22:32:33.836Z] [worker-~diagnostic~-4e38f491-edc5-4e54-a8b2-d6c15d233ad1]: IDLE {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-4e38f491-edc5-4e54-a8b2-d6c15d233ad1]: IDLE"}}
[debug] [2020-12-05T22:32:33.858Z] Dec 05, 2020 5:32:33 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
 {"metadata":{"emulator":{"name":"firestore"},"message":"Dec 05, 2020 5:32:33 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-12-05T22:32:33.982Z] Dec 05, 2020 5:32:33 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
 {"metadata":{"emulator":{"name":"firestore"},"message":"Dec 05, 2020 5:32:33 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected HTTP/2 connection.\n"}}
[debug] [2020-12-05T22:32:34.496Z] <<< HTTP RESPONSE 200 {"content-type":"application/json","content-length":"4"}
[info] ✔  functions[users-newUserActions]: firestore function initialized. {"metadata":{"emulator":{"name":"functions"},"message":"\u001b[1mfirestore\u001b[22m function initialized."}}
[info] 
┌────────────────────────────────────────────────────────────────┐
│ ✔  All emulators ready! View status and logs at localhost:4001 │
└────────────────────────────────────────────────────────────────┘

┌────────────────┬────────────────┬──────────────────────────┐
│ Emulator       │ Host:Port      │ View in Emulator UI      │
├────────────────┼────────────────┼──────────────────────────┤
│ Authentication │ localhost:9099 │ localhost:4001/auth      │
├────────────────┼────────────────┼──────────────────────────┤
│ Functions      │ localhost:5001 │ localhost:4001/functions │
├────────────────┼────────────────┼──────────────────────────┤
│ Firestore      │ localhost:8080 │ localhost:4001/firestore │
├────────────────┼────────────────┼──────────────────────────┤
│ Hosting        │ localhost:5000 │ n/a                      │
└────────────────┴────────────────┴──────────────────────────┘
  Other reserved ports: 4400, 4500

Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.

[debug] [2020-12-05T22:33:53.221Z] >>> [apiv2][query] POST http://localhost:5001/functions/projects/finta-app/trigger_multicast [none]
[debug] [2020-12-05T22:33:53.222Z] >>> [apiv2][body] POST http://localhost:5001/functions/projects/finta-app/trigger_multicast {"eventType":"providers/firebase.auth/eventTypes/user.create","data":{"uid":"KbRrDEXzUb1t5Dcy8BEgJG98Xl03","email":"test@gmail.com","emailVerified":false,"displayName":"Test","photoURL":"","metadata":{"creationTime":"1607207633219","lastSignInTime":"1607207633219"},"customClaims":{},"providerData":[{"providerId":"password","email":"test@gmail.com","federatedId":"test@gmail.com","rawId":"test@gmail.com","displayName":"Test","photoUrl":""}]}}
[debug] [2020-12-05T22:33:53.230Z] <<< [apiv2][status] POST http://localhost:5001/functions/projects/finta-app/trigger_multicast 200
[debug] [2020-12-05T22:33:53.231Z] <<< [apiv2][body] POST http://localhost:5001/functions/projects/finta-app/trigger_multicast {"status":"multicast_acknowledged"}
malcolmdeck commented 3 years ago

@TaylorFacen Can you please include the app code that you would expect to trigger a link to be printed? I don't think user creation in and of itself will create a link

IsaiahByDayah commented 3 years ago

To build on what @malcolmdeck said, thats my experience. Once you log in though, calling user.sendEmailVerification() DOES print a URL you can visit to "verify" the emulated user's email

alexmcmanus commented 3 years ago

For me, the issue is with the interaction with Cloud Functions in the emulator. This Cloud Function runs without error, but auth does not log the verification URL:

const functions = require('firebase-functions')
const admin = require('firebase-admin')

exports.initializeUser = functions.auth.user().onCreate(async user => {
      const adminUser = await admin.auth().getUser(user.uid)
      await adminUser.sendEmailVerification()
})

However, if I call user.sendEmailVerification() from the client running in the browser, it logs the verification link as expected.

Sulejmancheg commented 2 years ago

For me, the issue is with the interaction with Cloud Functions in the emulator. This Cloud Function runs without error, but auth does not log the verification URL:

const functions = require('firebase-functions')
const admin = require('firebase-admin')

exports.initializeUser = functions.auth.user().onCreate(async user => {
      const adminUser = await admin.auth().getUser(user.uid)
      await adminUser.sendEmailVerification()
})

However, if I call user.sendEmailVerification() from the client running in the browser, it logs the verification link as expected.

To log email verification link with Cloud Functions into console you can try this:

const functions = require('firebase-functions')
const admin = require('firebase-admin')

exports.initializeUser = functions.auth.user().onCreate(async user => {
    const email = user.email!
    const verificationLink = await admin.auth().generateEmailVerificationLink(email)
    functions.logger.log(verificationLink)
})