mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
feat: add gitlab provider (#273)
Signed-off-by: sh1luo <690898835@qq.com>
This commit is contained in:
@ -55,10 +55,14 @@ const LinkedInAuthLogo = `${StaticBaseUrl}/img/social_linkedin.png`;
|
||||
const WeComAuthUri = "https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect";
|
||||
const WeComAuthLogo = `${StaticBaseUrl}/img/social_wecom.png`;
|
||||
|
||||
// const WeComAuthScope = "";
|
||||
// const LarkAuthScope = "";
|
||||
const LarkAuthUri = "https://open.feishu.cn/open-apis/authen/v1/index";
|
||||
const LarkAuthLogo = `${StaticBaseUrl}/img/social_lark.png`;
|
||||
|
||||
const GitLabAuthScope = "read_user+profile";
|
||||
const GitLabAuthUri = "https://gitlab.com/oauth/authorize";
|
||||
const GitLabAuthLogo = `${StaticBaseUrl}/img/social_gitlab.png`;
|
||||
|
||||
export function getAuthLogo(provider) {
|
||||
if (provider.type === "Google") {
|
||||
return GoogleAuthLogo;
|
||||
@ -82,6 +86,8 @@ export function getAuthLogo(provider) {
|
||||
return WeComAuthLogo;
|
||||
} else if (provider.type === "Lark") {
|
||||
return LarkAuthLogo;
|
||||
} else if (provider.type === "GitLab") {
|
||||
return GitLabAuthLogo;
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,5 +120,7 @@ export function getAuthUrl(application, provider, method) {
|
||||
return `${WeComAuthUri}?appid=${provider.clientId}&redirect_uri=${redirectUri}&state=${state}&usertype=member`
|
||||
} else if (provider.type === "Lark") {
|
||||
return `${LarkAuthUri}?app_id=${provider.clientId}&redirect_uri=${redirectUri}&state=${state}`
|
||||
} else if (provider.type === "GitLab") {
|
||||
return `${GitLabAuthUri}?client_id=${provider.clientId}&redirect_uri=${redirectUri}&state=${state}&response_type=code&scope=${GitLabAuthScope}`
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user