mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 20:23:50 +08:00
feat: support OIDC device flow: "/api/device-auth" (#3757)
This commit is contained in:
@ -61,7 +61,14 @@ export function oAuthParamsToQuery(oAuthParams) {
|
||||
}
|
||||
|
||||
export function getApplicationLogin(params) {
|
||||
const queryParams = (params?.type === "cas") ? casLoginParamsToQuery(params) : oAuthParamsToQuery(params);
|
||||
let queryParams = "";
|
||||
if (params?.type === "cas") {
|
||||
queryParams = casLoginParamsToQuery(params);
|
||||
} else if (params?.type === "device") {
|
||||
queryParams = `?userCode=${params.userCode}&type=device`;
|
||||
} else {
|
||||
queryParams = oAuthParamsToQuery(params);
|
||||
}
|
||||
return fetch(`${authConfig.serverUrl}/api/get-app-login${queryParams}`, {
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
|
Reference in New Issue
Block a user