# Log in user via link in email?

**URL:** <https://forum.bubble.io/t/log-in-user-via-link-in-email/153119>\
**Category:** Need help\
**Created:** [May 26, 2021, 7:12pm UTC](https://forum.bubble.io/t/log-in-user-via-link-in-email/153119 "2021-05-26T19:12:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmbehrens](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jmbehrens](https://forum.bubble.io/u/jmbehrens)\
**Post date:** [May 26, 2021, 7:12pm UTC](https://forum.bubble.io/t/log-in-user-via-link-in-email/153119/1 "2021-05-26T19:12:44Z")

</div>

Hello,

Hoping someone can help me understand the “Log in a user…” workflow.

The app I’m building has a messaging function that can trigger an email to the recipient. I’d like to have a “reply” link (or similar) that includes the recipients user ID as a parameter.

Ideally, when that user clicks the link, the app:

checks for an existing login → if there is none, makes sure the user ID is valid and automatically passes the email and password corresponding to that user ID, logging them in.

The issue is that I’m unable to pull the target user’s password in the “Log in a user…” workflow function. I’ve read that a potential workaround might be to store the users password as text in my database, but I’m not thrilled with that option at all.

Anyone encountered this before?

Thanks!

---

<div class="post-metadata">

**Author:** ![cmarchan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cmarchan/32/253062_2.png) [@cmarchan](https://forum.bubble.io/u/cmarchan)\
**Post date:** [May 26, 2021, 7:26pm UTC](https://forum.bubble.io/t/log-in-user-via-link-in-email/153119/2 "2021-05-26T19:26:23Z")

</div>

Hello @jmbehrens welcome to the community!

Challenging use case you are facing.

The app should log in a user with no password. Bubble does not work that way.

Suggested alternatives:

1. Invite the user to log in
2. Allow functionality for that page for logged out users … BUT whose url user ID exists in the database

---

<div class="post-metadata">

**Author:** ![cmarchan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cmarchan/32/253062_2.png) [@cmarchan](https://forum.bubble.io/u/cmarchan)\
**Post date:** [May 26, 2021, 7:28pm UTC](https://forum.bubble.io/t/log-in-user-via-link-in-email/153119/3 "2021-05-26T19:28:53Z")

</div>

@jmbehrens

1. I agree … a user password should not be housed in the database that evidently. It can be exposed to users that have access to your editor, you could be sending it inadvertently to the browser (… you could restrict this using privacy rules).

Option 3 is just not good practice.

---

<div class="post-metadata">

**Author:** ![jmbehrens](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jmbehrens](https://forum.bubble.io/u/jmbehrens)\
**Post date:** [May 26, 2021, 10:55pm UTC](https://forum.bubble.io/t/log-in-user-via-link-in-email/153119/4 "2021-05-26T22:55:12Z")

</div>

Thanks for your help!

I ended up doing a version of your second suggestion (essentially, pop up a modal with their email address pre-filled).

It would be nice to be able to create a workflow that reads a URL and says “if id=[user id] is valid, skip password requirement and log in the user”

Bummer

---

<div class="post-metadata">

**Author:** ![cmarchan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cmarchan/32/253062_2.png) [@cmarchan](https://forum.bubble.io/u/cmarchan)\
**Post date:** [May 26, 2021, 11:11pm UTC](https://forum.bubble.io/t/log-in-user-via-link-in-email/153119/5 "2021-05-26T23:11:01Z")

</div>

@jmbehrens

That would be the day… when platforms do not have to worry about security 😬

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [August 4, 2021, 7:13pm UTC](https://forum.bubble.io/t/log-in-user-via-link-in-email/153119/6 "2021-08-04T19:13:15Z")

</div>

Closed on August 4, 2021, 7:13pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
