added database
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/minio/minio-go/v7"
|
||||
|
||||
"git.kapelle.org/niklas/s3browser/internal/db"
|
||||
helper "git.kapelle.org/niklas/s3browser/internal/helper"
|
||||
"git.kapelle.org/niklas/s3browser/internal/loader"
|
||||
types "git.kapelle.org/niklas/s3browser/internal/types"
|
||||
@@ -203,8 +204,11 @@ func deleteDirectory(ctx context.Context, id types.ID) error {
|
||||
//login Checks for valid username password combination. Returns singed jwt string
|
||||
func login(ctx context.Context, username, password string) (types.LoginResult, error) {
|
||||
|
||||
// TODO: replace with propper user management
|
||||
if username != "admin" && password != "hunter2" {
|
||||
dbStore := ctx.Value("dbStore").(*db.DB)
|
||||
|
||||
succes, err := dbStore.CheckLogin(ctx, username, password)
|
||||
|
||||
if !succes {
|
||||
return types.LoginResult{
|
||||
Successful: false,
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user