feat(auth): refactor authentication handling by removing redundant checks and introducing dynamic auth method determination
This commit is contained in:
parent
6191066b2e
commit
f843bd4243
1 changed files with 12 additions and 19 deletions
|
|
@ -39,11 +39,6 @@ func (s *AuthServiceImpl) CheckAuthStatus(ctx context.Context, statusToken strin
|
|||
|
||||
// ValidateAuth validates authentication credentials
|
||||
func (s *AuthServiceImpl) ValidateAuth(ctx context.Context, auth model.Authentication) (bool, error) {
|
||||
// If authentication is not required, allow access
|
||||
if !s.config.RequireAuth {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// If authentication is required but not provided
|
||||
if auth.Method == "" || auth.Method == model.AuthMethodNone {
|
||||
return false, ErrAuthRequired
|
||||
|
|
|
|||
Loading…
Reference in a new issue