# Can I get user last\_name and first\_name on first login with passwordless magic link?

**URL:** <https://community.auth0.com/t/can-i-get-user-last-name-and-first-name-on-first-login-with-passwordless-magic-link/100083>\
**Category:** Get Help\
**Tags:** signup-prompt-new-experience, login-experience\
**Created:** [February 9, 2023, 1:19pm UTC](https://community.auth0.com/t/can-i-get-user-last-name-and-first-name-on-first-login-with-passwordless-magic-link/100083 "2023-02-09T13:19:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zakhar.levchuk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/zakhar.levchuk/32/44486_2.png) [@zakhar.levchuk](https://community.auth0.com/u/zakhar.levchuk)\
**Post date:** [February 9, 2023, 1:19pm UTC](https://community.auth0.com/t/can-i-get-user-last-name-and-first-name-on-first-login-with-passwordless-magic-link/100083/1 "2023-02-09T13:19:11Z")

</div>

I need to get user last name and first name on first login through magic link.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [February 9, 2023, 5:13pm UTC](https://community.auth0.com/t/can-i-get-user-last-name-and-first-name-on-first-login-with-passwordless-magic-link/100083/3 "2023-02-09T17:13:39Z")

</div>

Hi @zakhar.levchuk,

Welcome to the Auth0 Community!

After a user has logged in with a Passwordless Magic Link, there is an option to use an Auth0 [Post-Login Action](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow) to get the user’s first and last name.

Then to specifically check for the first login, you can add the `if (event.stats.logins_count === 1)` condition.

For example:

```auto
exports.onExecutePostLogin = async (event, api) => {
  if(event.stats.logins_counts === 1 ){
    var firstName = event.user.given_name
    var lastName = event.user.family_name
  } 
};

```

See the [Actions Triggers: post-login - Event Object](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/event-object) for the complete list of callable properties.

Please let me know how this works for you.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 23, 2023, 5:14pm UTC](https://community.auth0.com/t/can-i-get-user-last-name-and-first-name-on-first-login-with-passwordless-magic-link/100083/4 "2023-02-23T17:14:35Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
