Package com.surrealdb.signin
Class Token
java.lang.Object
com.surrealdb.signin.Token
Authentication tokens returned by signin and signup. Contains an access token
(required) and an optional refresh token. When the server returns only a
single JWT, it is exposed as the access token and refresh is null.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Token
-
Token
Legacy constructor: single token string as access token, no refresh.- Parameters:
token- the access token
-
-
Method Details
-
getAccess
Returns the access token (JWT) used for authenticating requests.- Returns:
- the access token
-
getRefresh
Returns the refresh token if the server provided one, otherwise null.- Returns:
- the refresh token or null
-
getToken
Returns the access token. Kept for backward compatibility; prefergetAccess().- Returns:
- the access token
-