retrieve method
Retrieves the current authenticated user's information.
This method fetches the complete user profile for the currently authenticated user, including their ID, email, name, avatar, tags, and creation timestamp.
Returns
A Future that resolves to a User object containing the current user's information
Throws
CalljmpExceptionif the user is not authenticatedHttpExceptionif there's a network error
Example
try {
final user = await calljmp.users.retrieve();
print('Current user: ${user.name} (${user.email})');
} catch (e) {
print('Failed to retrieve user: $e');
}
Implementation
Future<User> retrieve() => http
.request("${_config.serviceUrl}/users")
.use(http.context(_config))
.use(http.access())
.get()
.json((json) => User.fromJson(json));