Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
go-atomci
atomci
提交
5eb9f4e8
atomci
项目概览
go-atomci
/
atomci
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
atomci
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
5eb9f4e8
编写于
9月 21, 2022
作者:
C
colynn.liu
提交者:
GitHub
9月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #182 from go-atomci/feat-update-auth-layout
fix: public pkg clean log print
上级
596fb280
2a3b7e0c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
3 addition
and
9 deletion
+3
-9
internal/api/auth.go
internal/api/auth.go
+1
-1
pkg/auth/ldap/ldap.go
pkg/auth/ldap/ldap.go
+1
-5
pkg/auth/local/local.go
pkg/auth/local/local.go
+1
-3
未找到文件。
internal/api/auth.go
浏览文件 @
5eb9f4e8
...
...
@@ -100,7 +100,7 @@ func (a *AuthController) Authenticate() {
log
.
Log
.
Debug
(
"externalAccountInfo user: %s"
,
externalAccountInfo
.
User
)
}
else
{
log
.
Log
.
Error
(
"login authenticate error: %v"
,
authErr
.
Error
())
http
.
Error
(
a
.
Ctx
.
ResponseWriter
,
authErr
.
Error
()
,
http
.
StatusInternalServerError
)
http
.
Error
(
a
.
Ctx
.
ResponseWriter
,
"用户不存在或密码错误"
,
http
.
StatusInternalServerError
)
return
}
...
...
pkg/auth/ldap/ldap.go
浏览文件 @
5eb9f4e8
...
...
@@ -19,7 +19,6 @@ package ldap
import
(
"fmt"
"github.com/go-atomci/atomci/internal/middleware/log"
"github.com/go-atomci/atomci/pkg/auth"
"github.com/astaxie/beego"
...
...
@@ -66,10 +65,7 @@ func (p *Provider) Authenticate(user, password string) (*auth.ExternalAccount, e
authVerify
,
resp
,
err
:=
client
.
Authenticate
(
user
,
password
)
if
!
authVerify
{
if
err
!=
nil
{
log
.
Log
.
Error
(
"authVerify error: %s"
,
err
.
Error
())
}
return
nil
,
fmt
.
Errorf
(
"域帐号或密码错误,或请联系管理员"
)
return
nil
,
fmt
.
Errorf
(
"authVerify error: %v"
,
err
)
}
// TODO: resp add verification
...
...
pkg/auth/local/local.go
浏览文件 @
5eb9f4e8
...
...
@@ -19,7 +19,6 @@ package local
import
(
"fmt"
"github.com/go-atomci/atomci/internal/middleware/log"
"github.com/go-atomci/atomci/pkg/auth"
"golang.org/x/crypto/bcrypt"
...
...
@@ -47,8 +46,7 @@ func NewProvider(opts ...Option) auth.Provider {
func
(
p
*
Provider
)
Authenticate
(
loginUser
,
password
string
)
(
*
auth
.
ExternalAccount
,
error
)
{
_
,
err
:=
CompareHashAndPassword
(
p
.
password
,
password
)
if
err
!=
nil
{
log
.
Log
.
Error
(
"comparehas password, error: %v"
,
err
.
Error
())
return
nil
,
fmt
.
Errorf
(
"用户不存在或密码错误"
)
return
nil
,
fmt
.
Errorf
(
"comparehas password, error: %v"
,
err
.
Error
())
}
return
&
auth
.
ExternalAccount
{
Name
:
p
.
name
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录