# How to access logged in members profile page?

**URL:** <https://forum.wixstudio.com/t/how-to-access-logged-in-members-profile-page/9843>\
**Category:** Ask the community\
**Tags:** question, code, wix-members-area\
**Created:** [November 27, 2022, 10:48am UTC](https://forum.wixstudio.com/t/how-to-access-logged-in-members-profile-page/9843 "2022-11-27T10:48:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kricke73](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/kricke73/32/31574_2.png) [@kricke73](https://forum.wixstudio.com/u/kricke73)\
**Post date:** [November 27, 2022, 10:48am UTC](https://forum.wixstudio.com/t/how-to-access-logged-in-members-profile-page/9843/1 "2022-11-27T10:48:41Z")

</div>

What is the fault in this code because when I click on button1 I am relocated but it can´t find anything. Same fault with button 2 to get to the account page. Very confusing because I have copied the exact URL for the both pages (not a specific members profile and account URL but to the two dynamic pages.

When I try without code and through a direct database-connection I am relocated to the wrong members profile page (same with account).

import { currentMember } **from** ‘wix-members’ ;  
import wixLocation **from** ‘wix-location’ ;  
import wixUsers **from** ‘wix-users’ ;

export function myGetCurrentMemberFunction ( options ) {  
**return** currentMember . getMember ( options )  
. then (( member ) =\> {  
**const** memberId = member . \_id ;

```
  **return** member ; 
}) 
. **catch** (( error ) => { 
  console . error ( error ); 
}) 

```

}  
export function button1\_click ( event ) {  
wixLocation . to ( `/members/profile/{ID}` );  
}  
export function button2\_onclick ( event ) {  
wixLocation . to ( `/members/account/{ID}` );  
}
