mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-21 23:21:26 +01:00
updates for meeting golint check.
This commit is contained in:
parent
255488157f
commit
853f3d91c9
@ -114,9 +114,9 @@ func (cc *CommonController) Render() error {
|
||||
}
|
||||
|
||||
// Login handles login request from UI.
|
||||
func (c *CommonController) Login() {
|
||||
principal := c.GetString("principal")
|
||||
password := c.GetString("password")
|
||||
func (cc *CommonController) Login() {
|
||||
principal := cc.GetString("principal")
|
||||
password := cc.GetString("password")
|
||||
|
||||
user, err := auth.Login(models.AuthModel{
|
||||
Principal: principal,
|
||||
@ -124,15 +124,15 @@ func (c *CommonController) Login() {
|
||||
})
|
||||
if err != nil {
|
||||
log.Errorf("Error occurred in UserLogin: %v", err)
|
||||
c.CustomAbort(http.StatusUnauthorized, "")
|
||||
cc.CustomAbort(http.StatusUnauthorized, "")
|
||||
}
|
||||
|
||||
if user == nil {
|
||||
c.CustomAbort(http.StatusUnauthorized, "")
|
||||
cc.CustomAbort(http.StatusUnauthorized, "")
|
||||
}
|
||||
|
||||
c.SetSession("userId", user.UserID)
|
||||
c.SetSession("username", user.Username)
|
||||
cc.SetSession("userId", user.UserID)
|
||||
cc.SetSession("username", user.Username)
|
||||
}
|
||||
|
||||
// LogOut Habor UI
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"github.com/vmware/harbor/utils/log"
|
||||
)
|
||||
|
||||
// NavigationHeaderController handles requests to /navigation_detail
|
||||
// NavigationDetailController handles requests to /navigation_detail
|
||||
type NavigationDetailController struct {
|
||||
BaseController
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user