feat: integrate alist with casdoor (#1453)

* feat: integrate alist with casdoor

* fix: casdoor as an option for login

Co-authored-by: wenxuan70 <t736660416@gmail.com>
This commit is contained in:
wenxuan70
2022-08-06 16:47:39 +08:00
committed by GitHub
parent 5e59b0a697
commit 51b8b4380d
13 changed files with 449 additions and 30 deletions

View File

@@ -8,16 +8,6 @@ import (
func Auth(c *gin.Context) {
token := c.GetHeader("Authorization")
//password, err := model.GetSettingByKey("password")
//if err != nil {
// if err == gorm.ErrRecordNotFound {
// common.ErrorResp(c, fmt.Errorf("password not set"), 400)
// return
// }
// common.ErrorResp(c, err, 500)
// return
//}
//if token != utils.GetMD5Encode(password.Value) {
if token != conf.Token {
common.ErrorStrResp(c, "Invalid token", 401)
return