diff --git a/authentication.md b/authentication.md index 69d376c..7cd8a3b 100644 --- a/authentication.md +++ b/authentication.md @@ -14,5 +14,9 @@ const authRes = await window.Pi.authenticate(scopes, onIncompletePaymentFound); ### 2. Make a GET request to `/me` Pi API endpoint using the access token for verification To verify the data you got in step 1, you need to make a GET request to `/me` Pi API endpoint, with the access token included in the header. If the access token is valid, it will return a response with [UserDTO](./platform_API.md#UserDTO). However, if the token is invalid, it will return HTTP 401 Unauthorized code. ```javascript -const me = await axios.get('https://api.minepi.com/v2/me', {headers: {'Authorization': `Bearer ${accessToken}}}); +const me = await axios.get('https://api.minepi.com/v2/me', {headers: {'Authorization': `Bearer ${accessToken}`}}); +``` +or +```javascript +const me = await fetch('https://api.minepi.com/v2/me',{headers:{'Authorization': `Bearer ${accessToken}`}}); ```