# 401 Unauthorized issue at /api/auth/me!

**URL:** <https://community.auth0.com/t/401-unauthorized-issue-at-api-auth-me/89761>\
**Category:** Get Help\
**Tags:** api, login, auth0\
**Created:** [August 31, 2022, 11:10am UTC](https://community.auth0.com/t/401-unauthorized-issue-at-api-auth-me/89761 "2022-08-31T11:10:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshay.bisht](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/akshay.bisht/32/34068_2.png) [@akshay.bisht](https://community.auth0.com/u/akshay.bisht)\
**Post date:** [August 31, 2022, 11:10am UTC](https://community.auth0.com/t/401-unauthorized-issue-at-api-auth-me/89761/1 "2022-08-31T11:10:07Z")

</div>

Continuing the discussion from [Nextjs-auth0 - 401 Error when not logged in?](https://community.auth0.com/t/nextjs-auth0-401-error-when-not-logged-in/86311):

I am having the same issue with 401 Unauthorized on “[http://localhost:3000/api/auth/me](http://localhost:3000/api/auth/me)” on the browser. Any solution will be really helpful.

 ![Screenshot (233)](https://global.discourse-cdn.com/auth0/original/3X/8/c/8cf2557e8db9eb957e9f61141d59dc6cbb7d4867.png)

---

<div class="post-metadata">

**Author:** ![Rango-dz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rango-dz/32/39686_2.png) [@Rango-dz](https://community.auth0.com/u/Rango-dz)\
**Post date:** [September 1, 2022, 8:56pm UTC](https://community.auth0.com/t/401-unauthorized-issue-at-api-auth-me/89761/2 "2022-09-01T20:56:40Z")

</div>

I’m having the same problem, i have been searching for a solution for the past few days came up with nothing

---

<div class="post-metadata">

**Author:** ![jack6](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jack6/32/33232_2.png) [@jack6](https://community.auth0.com/u/jack6)\
**Post date:** [October 11, 2022, 9:36pm UTC](https://community.auth0.com/t/401-unauthorized-issue-at-api-auth-me/89761/3 "2022-10-11T21:36:23Z")

</div>

did u ever find a solution for this ?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [October 11, 2022, 10:45pm UTC](https://community.auth0.com/t/401-unauthorized-issue-at-api-auth-me/89761/5 "2022-10-11T22:45:36Z")

</div>

Hey there @jack6!

This is expected behavior - The front end uses `/api/auth/me` endpoint to check if the user is authenticated or not (401 = logged out, 200 = logged in). You could technically adjust the profile handler to _not_ return 401, but this would also require you to write your own front end code to get the user sessions since the `useUser` hook expects that API to respond with a 401 if the user is unauthenticated.

Given this has surfaced multiple times already, I definitely recommend creating a [feedback request](https://community.auth0.com/c/feedback/95) as our product team monitors these for community engagement.

---

<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:** [October 25, 2022, 10:48pm UTC](https://community.auth0.com/t/401-unauthorized-issue-at-api-auth-me/89761/7 "2022-10-25T22:48:10Z")

</div>

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