From ae10e121875982d6956d6bff453544cc59a75616 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Tue, 12 Sep 2023 18:37:30 +0200 Subject: feat: Add admin control Now only admins can access settings. --- pkg/service/auth.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'pkg/service') diff --git a/pkg/service/auth.go b/pkg/service/auth.go index 2fc06e3..3811965 100644 --- a/pkg/service/auth.go +++ b/pkg/service/auth.go @@ -147,15 +147,12 @@ func (u *AuthController) Upsert( } type ( - AuthKey string - Token struct { + Token struct { UserID uint Username string } ) -const TokenKey AuthKey = "token" - func ReadToken(data []byte, key []byte) (*Token, error) { block, err := aes.NewCipher(key) if err != nil { -- cgit v1.2.3