AuthResponse.fromJson constructor
Creates a response from a map
data The response data map
Implementation
factory AuthResponse.fromJson(Map<String, dynamic> data) {
return AuthResponse(
user: data['user'] as Map<String, dynamic>,
accessToken: data['access_token'] as String?,
refreshToken: data['refresh_token'] as String?,
tokenType: data['token_type'] as String? ?? 'Bearer',
expiresIn: data['expires_in'] as int?,
refreshExpiresIn: data['refresh_expires_in'] as int?,
metadata: data['metadata'] as Map<String, dynamic>?,
);
}