mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 02:57:22 +00:00
oidc buttons, depends on server options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -109,7 +109,7 @@ class UserModel {
|
||||
try {
|
||||
body = jsonDecode(resp.body);
|
||||
} catch (e) {
|
||||
print("jsonDecode resp body failed: ${e.toString()}");
|
||||
print("login: jsonDecode resp body failed: ${e.toString()}");
|
||||
rethrow;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ class UserModel {
|
||||
try {
|
||||
loginResponse = LoginResponse.fromJson(body);
|
||||
} catch (e) {
|
||||
print("jsonDecode LoginResponse failed: ${e.toString()}");
|
||||
print("login: jsonDecode LoginResponse failed: ${e.toString()}");
|
||||
rethrow;
|
||||
}
|
||||
|
||||
@@ -131,4 +131,15 @@ class UserModel {
|
||||
|
||||
return loginResponse;
|
||||
}
|
||||
|
||||
static Future<List<dynamic>> queryLoginOptions() async {
|
||||
final url = await bind.mainGetApiServer();
|
||||
final resp = await http.get(Uri.parse('$url/api/login-options'));
|
||||
try {
|
||||
return jsonDecode(resp.body);
|
||||
} catch (e) {
|
||||
print("queryLoginOptions: jsonDecode resp body failed: ${e.toString()}");
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user