Hi everyone,
I’m building an app for a membership-based association. Members have a physical card but most don’t have an email registered with us. I need help finding the cleanest way to handle account activation.
The flow I need
- Member opens app → “First access” page → enters card number + first name + last name (NO email, NO password)
- System verifies against a pre-loaded data type (AnagraficaSocio, separate from User)
- If valid → creates User account, then redirects to a “Setup credentials” page
- On setup page: user enters real email + chosen password
- From then on: login normally with email + password (or with card number + password)
My current approach
Since “Sign the user up” requires an email, I’m:
- Generating a fake email at signup:
card-{number}-{random}@myapp.local - Generating a random password (user never sees it)
- Storing a custom
setup_token(64-char random) + expiry (1 hour) on the User - Redirecting to /setup-credenziali?token=xxx
- On that page, I need to swap fake email → real email, and random password → user’s password
Where I’m stuck
For the credential swap, I’m planning this backend workflow sequence:
- Verify token (search User by setup_token + expiry not passed)
- “Assign a temp password to a user” on the target User
- “Log the user in” with fake email + temp password
- “Update email” with real email
- Return temp password to frontend
- Frontend then runs “Update user credentials” workflow with old=temp, new=user-chosen
Question 1: Is this the recommended way, or is there a cleaner pattern?
Question 2: I noticed Bubble docs mention “Send magic login link” can generate links server-side WITHOUT sending email. Could this replace my custom token logic? Has anyone used it this way?
Question 3: For dual login (email OR card number + password), I’m searching User by card number with a privacy rule that allows logged-out users to view only email and numero_tessera. Is this safe enough, or are there better patterns?
Thanks for any tips! I’ve read multiple older threads on similar topics but most are from 2018-2021 and approaches may have changed.