common oidc

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-07-20 08:05:38 +08:00
parent 6111042907
commit dab956fe85
10 changed files with 51 additions and 30 deletions

View File

@ -163,15 +163,15 @@ class UserModel {
return loginResponse;
}
static Future<List<dynamic>> queryLoginOptions() async {
static Future<List<dynamic>> queryOidcLoginOptions() async {
try {
final url = await bind.mainGetApiServer();
if (url.trim().isEmpty) return [];
final resp = await http.get(Uri.parse('$url/api/login-options'));
final resp = await http.get(Uri.parse('$url/api/oidc/login-options'));
return jsonDecode(resp.body);
} catch (e) {
debugPrint(
"queryLoginOptions: jsonDecode resp body failed: ${e.toString()}");
"queryOidcLoginOptions: jsonDecode resp body failed: ${e.toString()}");
return [];
}
}