getLoginUrl static method
Get the login URL from the server
Implementation
static Future<Uri?> getLoginUrl(
{required Function onSuccess,
required Function(String) onFailure}) async {
try {
Response link = await BaseApi.getInstance
.get(Uri.https(CliConstants.baseUrl, CliConstants.authenticatePath));
if (link.statusCode >= 200 && link.statusCode < 300) {
return Uri.parse(json.decode(link.body)['github_oauth_url']);
} else {
onFailure.call(link.reasonPhrase ?? link.body);
return null;
}
} catch (e) {
wtLog.error(e.toString());
return null;
}
}