diff --git a/handlers/handlers.go b/handlers/handlers.go index 2e15116..607e072 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -197,7 +197,7 @@ func SigninPost(client *ent.Client) echo.HandlerFunc { return c.Redirect(302, "/signin") } - ctx := context.WithValue(context.Background(), "logger", log) + ctx := context.WithValue(context.Background(), "l", log) if usr, err := moduser.QueryUser(ctx, client, username); err == nil { log.Info("queried user:", &usr.ID) @@ -300,7 +300,7 @@ func SignupPost(client *ent.Client) echo.HandlerFunc { username = uname if passwd := c.Request().FormValue("password"); passwd != "" { - ctx := context.WithValue(context.Background(), "logger", log) + ctx := context.WithValue(context.Background(), "l", log) u, err := moduser.CreateUser(ctx, client, username, passwd) if err != nil { diff --git a/modules/user/user.go b/modules/user/user.go index 508255b..b87616e 100644 --- a/modules/user/user.go +++ b/modules/user/user.go @@ -11,7 +11,7 @@ import ( // CreateUser adds a user entry to the database. func CreateUser(ctx context.Context, client *ent.Client, username, password string) (*ent.User, error) { - log := ctx.Value("logger").(*slogging.Logger) + log := ctx.Value("l").(*slogging.Logger) u, err := client.User. Create(). @@ -29,7 +29,7 @@ func CreateUser(ctx context.Context, client *ent.Client, username, password stri } func QueryUser(ctx context.Context, client *ent.Client, username string) (*ent.User, error) { - log := ctx.Value("logger").(*slogging.Logger) + log := ctx.Value("l").(*slogging.Logger) u, err := client.User. Query().