--- id: auth-getuser title: 'getUser()' slug: /auth-getuser custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml --- import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' Gets the current user details if there is an existing session. ```js const { data: { user }, } = await supabase.auth.getUser() ``` ## Parameters ## Notes - This method gets the user object using the current session. - Fetches the user object from the database instead of local storage. ## Examples ### Get the logged in user with the current existing session ```js const { data: { user }, } = await supabase.auth.getUser() ``` ### Get the logged in user with a custom access token jwt. ```js const { data: { user }, } = await supabase.auth.getUser(jwt) ```