From 2857052a38c9ad2c5946f6101bf7d37d63235df8 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sat, 19 Aug 2023 16:50:04 +0200 Subject: fix: Fix various linting error --- pkg/service/auth.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'pkg/service') diff --git a/pkg/service/auth.go b/pkg/service/auth.go index f27cf88..30e574a 100644 --- a/pkg/service/auth.go +++ b/pkg/service/auth.go @@ -105,7 +105,7 @@ func (u *AuthController) Upsert( ) error { if id != nil { if err := u.userRepository.Update(ctx, *id, &repository.UpdateUser{ - Username: string(username), + Username: username, Name: name, IsAdmin: isAdmin, Path: path, @@ -140,10 +140,15 @@ func (u *AuthController) Upsert( return err } -type Token struct { - UserID uint - Username string -} +type ( + AuthKey string + Token struct { + UserID uint + Username string + } +) + +const TokenKey AuthKey = "token" func ReadToken(data []byte, key []byte) (*Token, error) { block, err := aes.NewCipher(key) -- cgit v1.2.3