NEAR Intents: Refresh Access Token
post /v0/auth/refresh Exchange a refresh token for a new access token
Once the accessToken from Authenticate User with Signed Data expires, exchange refreshToken for a new accessToken without re-signing.
Example request
curl -X POST https://1click.chaindefuser.com/v0/auth/refresh \
-H "Content-Type: application/json" \
-d '{ "refreshToken": "YOUR_REFRESH_TOKEN" }'
const response = await fetch('https://1click.chaindefuser.com/v0/auth/refresh', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ refreshToken: 'YOUR_REFRESH_TOKEN' })
});
const auth = await response.json();
Example response
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 3600
}
[!NOTE]
The response only contains a new
accessToken,refreshTokenitself does not rotate. Keep using the samerefreshTokenuntil it expires (refreshExpiresInfrom the original authenticate call).