Skip to content

Commit

Permalink
check for valid flavour (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
KathurimaKimathi committed Sep 27, 2021
1 parent cdb3dc0 commit cd8f902
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Expand Up @@ -58,6 +58,7 @@ jobs:
go get github.com/fzipp/gocyclo
go get github.com/stretchr/testify/assert@v1.7.0
go get github.com/ory/go-acc
go get golang.org/x/oauth2/internal
go install github.com/savannahghi/bewellcli@$CLI_VERSION
- name: Run lint and test
Expand Down
4 changes: 4 additions & 0 deletions pkg/onboarding/usecases/login.go
Expand Up @@ -58,6 +58,10 @@ func (l *LoginUseCasesImpl) LoginByPhone(
ctx, span := tracer.Start(ctx, "LoginByPhone")
defer span.End()

if ok := flavour.IsValid(); !ok {
return nil, exceptions.WrongEnumTypeError(flavour.String())
}

phoneNumber, err := l.baseExt.NormalizeMSISDN(phone)
if err != nil {
utils.RecordSpanError(span, err)
Expand Down

0 comments on commit cd8f902

Please sign in to comment.