setAuthToken method
Sets the authentication token under currentToken
In addition, updates RequestOptions
's Authorization header formatted as:
TOKEN_HEADER + token
Implementation
@override
@protected
@visibleForTesting
void setAuthToken(String? token) {
currentToken = token;
// Can't use the standard Bearer <token> format since frappe treats that as something else
// frappe/api.py validate_oauth() checks for the presence of the keyword 'Bearer'
RenovationRequestOptions.headers!['Authorization'] = '$TOKEN_HEADER $token';
}