Mercurial > gemma
comparison pkg/auth/session.go @ 4160:7cccf7fef3e8
Made 'golint' and 'staticcheck' happy with auth package.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 02 Aug 2019 17:08:58 +0200 |
parents | 0db742c7813d |
children | 91f4b3f56ce2 |
comparison
equal
deleted
inserted
replaced
4159:80e9cfb2be98 | 4160:7cccf7fef3e8 |
---|---|
152 return base64.URLEncoding.EncodeToString( | 152 return base64.URLEncoding.EncodeToString( |
153 common.GenerateRandomKey(sessionKeyLength)) | 153 common.GenerateRandomKey(sessionKeyLength)) |
154 } | 154 } |
155 | 155 |
156 // ErrInvalidRole is returned if a given role does not exsist in this system. | 156 // ErrInvalidRole is returned if a given role does not exsist in this system. |
157 var ErrInvalidRole = errors.New("Invalid role") | 157 var ErrInvalidRole = errors.New("invalid role") |
158 | 158 |
159 // GenerateSession creates a new session for a given user and password | 159 // GenerateSession creates a new session for a given user and password |
160 // backed by the roles of this user in the database. | 160 // backed by the roles of this user in the database. |
161 func GenerateSession(user, password string) (string, *Session, error) { | 161 func GenerateSession(user, password string) (string, *Session, error) { |
162 roles, err := AllOtherRoles(user, password) | 162 roles, err := AllOtherRoles(user, password) |