diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-19 16:50:04 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-19 16:50:04 +0200 |
commit | 2857052a38c9ad2c5946f6101bf7d37d63235df8 (patch) | |
tree | 8c80c37560336171b5b0e550a0244ebbcfc1e160 /pkg/service/auth.go | |
parent | 6531b1c0a720a63ee3127f9a09f14ba861838b01 (diff) | |
download | lens-2857052a38c9ad2c5946f6101bf7d37d63235df8.tar.gz lens-2857052a38c9ad2c5946f6101bf7d37d63235df8.tar.bz2 lens-2857052a38c9ad2c5946f6101bf7d37d63235df8.zip |
fix: Fix various linting error
Diffstat (limited to 'pkg/service/auth.go')
-rw-r--r-- | pkg/service/auth.go | 15 |
1 files changed, 10 insertions, 5 deletions
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) |