mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Move middleware context handler logic to service (#29605)
* middleware: Move context handler to own service Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Emil Tullsted <sakjur@users.noreply.github.com> Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
@@ -25,12 +25,12 @@ var (
|
||||
var loginLogger = log.New("login")
|
||||
|
||||
func Init() {
|
||||
bus.AddHandler("auth", AuthenticateUser)
|
||||
bus.AddHandler("auth", authenticateUser)
|
||||
}
|
||||
|
||||
// AuthenticateUser authenticates the user via username & password
|
||||
func AuthenticateUser(query *models.LoginUserQuery) error {
|
||||
if err := validateLoginAttempts(query.Username); err != nil {
|
||||
// authenticateUser authenticates the user via username & password
|
||||
func authenticateUser(query *models.LoginUserQuery) error {
|
||||
if err := validateLoginAttempts(query); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user