# How to get the user's data right after login/signup?

**URL:** <https://community.auth0.com/t/how-to-get-the-users-data-right-after-login-signup/61547>\
**Category:** Get Help\
**Created:** [April 22, 2021, 9:19am UTC](https://community.auth0.com/t/how-to-get-the-users-data-right-after-login-signup/61547 "2021-04-22T09:19:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![faisalsayed10](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/faisalsayed10/32/28951_2.png) [@faisalsayed10](https://community.auth0.com/u/faisalsayed10)\
**Post date:** [April 22, 2021, 9:19am UTC](https://community.auth0.com/t/how-to-get-the-users-data-right-after-login-signup/61547/1 "2021-04-22T09:19:04Z")

</div>

Please include the following information in your post:

- **Which SDK this is regarding:** auth0-nextjs
- **SDK Version:** 1.3.0
- **Platform Version:** Next.js 10.1
- **Code Snippets/Error Messages/Supporting Details/Screenshots:**

How can I get the user’s details right after the user logs in / signs up?  
that is, right when the `handleLogin()` method is called, I want the user’s data. How can I get it?

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 23, 2021, 7:44pm UTC](https://community.auth0.com/t/how-to-get-the-users-data-right-after-login-signup/61547/3 "2021-04-23T19:44:07Z")

</div>

Hi @faisalsayed10,

Welcome to the Community!

You can use the `useUser` hook to get user data: [Auth0 Next.js SDK Quickstarts: Login](https://auth0.com/docs/quickstart/webapp/nextjs/01-login#show-user-profile-information)

```auto
import React from 'react';
import { useUser } from '@auth0/nextjs-auth0';

export default function Profile() {
  const { user, error, isLoading } = useUser();

  if (isLoading) return <div>Loading...</div>;
  if (error) return <div>{error.message}</div>;
  
  return (
    user && (
      <div>
        <img src={user.picture} alt={user.name} />
        <h2>{user.name}</h2>
        <p>{user.email}</p>
      </div>
    )
  );
}

```

Your app will need to be wrapped in the `UserProvider` component: [Auth0 Next.js SDK Quickstarts: Login](https://auth0.com/docs/quickstart/webapp/nextjs/01-login#add-the-userprovider-component)

```auto
import React from 'react';
import { UserProvider } from '@auth0/nextjs-auth0';

export default function App({ Component, pageProps }) {
  return (
    <UserProvider>
      <Component {...pageProps} />
    </UserProvider>
  );
}

```

You can also get user data from the `/api/auth/me` route.

You can find an example of this in the Next.js quickstart:

> **[Auth0 Next.js SDK Quickstarts: Login](https://auth0.com/docs/quickstart/webapp/nextjs/01-login)**
>
> This guide demonstrates how to integrate Auth0 with any new or existing Next.js application using the Auth0 Next.js SDK.

---

<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:** [May 8, 2021, 7:44pm UTC](https://community.auth0.com/t/how-to-get-the-users-data-right-after-login-signup/61547/4 "2021-05-08T19:44:07Z")

</div>

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