mirror of
https://github.com/casdoor/casdoor.git
synced 2025-08-30 02:50:23 +08:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
60096468fe | ||
![]() |
39d6bc10f7 | ||
![]() |
177f2f2f11 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -235,7 +235,7 @@ jobs:
|
|||||||
|
|
||||||
# Commit and push the changes back to the repository
|
# Commit and push the changes back to the repository
|
||||||
git config --global user.name "casbin-bot"
|
git config --global user.name "casbin-bot"
|
||||||
git config --global user.email "casbin-bot@github.com"
|
git config --global user.email "bot@casbin.org"
|
||||||
git add Chart.yaml index.yaml
|
git add Chart.yaml index.yaml
|
||||||
git commit -m "chore(helm): bump helm charts appVersion to ${{steps.get-current-tag.outputs.tag }}"
|
git commit -m "chore(helm): bump helm charts appVersion to ${{steps.get-current-tag.outputs.tag }}"
|
||||||
git push origin HEAD:master
|
git push origin HEAD:master
|
||||||
|
@@ -973,23 +973,27 @@ func (c *ApiController) GetWebhookEventType() {
|
|||||||
// @router /api/get-captcha-status [get]
|
// @router /api/get-captcha-status [get]
|
||||||
func (c *ApiController) GetCaptchaStatus() {
|
func (c *ApiController) GetCaptchaStatus() {
|
||||||
organization := c.Input().Get("organization")
|
organization := c.Input().Get("organization")
|
||||||
userId := c.Input().Get("user_id")
|
userId := c.Input().Get("userId")
|
||||||
user, err := object.GetUserByFields(organization, userId)
|
user, err := object.GetUserByFields(organization, userId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.ResponseError(err.Error())
|
c.ResponseError(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
failedSigninLimit, _, err := object.GetFailedSigninConfigByUser(user)
|
captchaEnabled := false
|
||||||
if err != nil {
|
if user != nil {
|
||||||
c.ResponseError(err.Error())
|
var failedSigninLimit int
|
||||||
return
|
failedSigninLimit, _, err = object.GetFailedSigninConfigByUser(user)
|
||||||
|
if err != nil {
|
||||||
|
c.ResponseError(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if user.SigninWrongTimes >= failedSigninLimit {
|
||||||
|
captchaEnabled = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var captchaEnabled bool
|
|
||||||
if user != nil && user.SigninWrongTimes >= failedSigninLimit {
|
|
||||||
captchaEnabled = true
|
|
||||||
}
|
|
||||||
c.ResponseOk(captchaEnabled)
|
c.ResponseOk(captchaEnabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -264,10 +264,13 @@ func (c *ApiController) BatchEnforce() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *ApiController) GetAllObjects() {
|
func (c *ApiController) GetAllObjects() {
|
||||||
userId := c.GetSessionUsername()
|
userId := c.Input().Get("userId")
|
||||||
if userId == "" {
|
if userId == "" {
|
||||||
c.ResponseError(c.T("general:Please login first"))
|
userId = c.GetSessionUsername()
|
||||||
return
|
if userId == "" {
|
||||||
|
c.ResponseError(c.T("general:Please login first"))
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
objects, err := object.GetAllObjects(userId)
|
objects, err := object.GetAllObjects(userId)
|
||||||
@@ -280,10 +283,13 @@ func (c *ApiController) GetAllObjects() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *ApiController) GetAllActions() {
|
func (c *ApiController) GetAllActions() {
|
||||||
userId := c.GetSessionUsername()
|
userId := c.Input().Get("userId")
|
||||||
if userId == "" {
|
if userId == "" {
|
||||||
c.ResponseError(c.T("general:Please login first"))
|
userId = c.GetSessionUsername()
|
||||||
return
|
if userId == "" {
|
||||||
|
c.ResponseError(c.T("general:Please login first"))
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
actions, err := object.GetAllActions(userId)
|
actions, err := object.GetAllActions(userId)
|
||||||
@@ -296,10 +302,13 @@ func (c *ApiController) GetAllActions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *ApiController) GetAllRoles() {
|
func (c *ApiController) GetAllRoles() {
|
||||||
userId := c.GetSessionUsername()
|
userId := c.Input().Get("userId")
|
||||||
if userId == "" {
|
if userId == "" {
|
||||||
c.ResponseError(c.T("general:Please login first"))
|
userId = c.GetSessionUsername()
|
||||||
return
|
if userId == "" {
|
||||||
|
c.ResponseError(c.T("general:Please login first"))
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
roles, err := object.GetAllRoles(userId)
|
roles, err := object.GetAllRoles(userId)
|
||||||
|
@@ -146,7 +146,7 @@ export function getWechatMessageEvent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getCaptchaStatus(values) {
|
export function getCaptchaStatus(values) {
|
||||||
return fetch(`${Setting.ServerUrl}/api/get-captcha-status?organization=${values["organization"]}&user_id=${values["username"]}`, {
|
return fetch(`${Setting.ServerUrl}/api/get-captcha-status?organization=${values["organization"]}&userId=${values["username"]}`, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
headers: {
|
headers: {
|
||||||
|
@@ -193,7 +193,7 @@ class ProviderTable extends React.Component {
|
|||||||
title: i18next.t("application:Rule"),
|
title: i18next.t("application:Rule"),
|
||||||
dataIndex: "rule",
|
dataIndex: "rule",
|
||||||
key: "rule",
|
key: "rule",
|
||||||
width: "100px",
|
width: "120px",
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
if (record.provider?.type === "Google") {
|
if (record.provider?.type === "Google") {
|
||||||
if (text === "None") {
|
if (text === "None") {
|
||||||
|
Reference in New Issue
Block a user