diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-12-11 17:05:12 +0100 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-12-11 17:05:12 +0100 |
commit | 1e45ae2ea3497958b2ea6a20137955cfc3bbc964 (patch) | |
tree | 00af0e28864d79d7a9cbb8b693aff1b397b1a949 /pkg/service | |
parent | e6ded0d01117c592ec124f3e02d6c89eeafec382 (diff) | |
download | cerrado-1e45ae2ea3497958b2ea6a20137955cfc3bbc964.tar.gz cerrado-1e45ae2ea3497958b2ea6a20137955cfc3bbc964.tar.bz2 cerrado-1e45ae2ea3497958b2ea6a20137955cfc3bbc964.zip |
feat: Add UI/Handler login process
It adds the whole workflow to store and handle login on both UI and
handler level. With that the login information should be available at
any point given the context.
Diffstat (limited to 'pkg/service')
-rw-r--r-- | pkg/service/auth.go | 8 | ||||
-rw-r--r-- | pkg/service/git.go | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pkg/service/auth.go b/pkg/service/auth.go index 1fbf4b6..0dbd960 100644 --- a/pkg/service/auth.go +++ b/pkg/service/auth.go @@ -23,7 +23,13 @@ type ( } ) -var tokenSeed = []byte("cerrado") +var tokenSeed = []byte("this is a token for cerrado") + +func NewAuthService(repostiory authRepository) *AuthService { + return &AuthService{ + authRepository: repostiory, + } +} func (a *AuthService) CheckAuth(username, password string) bool { passphrase := a.authRepository.GetPassphrase() diff --git a/pkg/service/git.go b/pkg/service/git.go index f03ba42..6c3912f 100644 --- a/pkg/service/git.go +++ b/pkg/service/git.go @@ -30,9 +30,7 @@ type ( } ) -var ( - ErrRepositoryNotFound = errors.New("Repository not found") -) +var ErrRepositoryNotFound = errors.New("Repository not found") // TODO: make it configurable const timeFormat = "2006.01.02 15:04:05" |