1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-15 00:15:15 +02:00

checkpoint

This commit is contained in:
Lee Brown
2019-06-26 20:21:00 -08:00
parent b68bcf2c2c
commit 48ae19bd6a
23 changed files with 1952 additions and 859 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"crypto/rsa"
"database/sql"
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/platform/web"
"github.com/dgrijalva/jwt-go"
"strings"
"time"
@ -15,7 +16,6 @@ import (
"github.com/pkg/errors"
"golang.org/x/crypto/bcrypt"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
"gopkg.in/go-playground/validator.v9"
)
// TokenGenerator is the behavior we need in our Authenticate to generate tokens for
@ -80,7 +80,8 @@ func SwitchAccount(ctx context.Context, dbConn *sqlx.DB, tknGen TokenGenerator,
}
// Validate the request.
err := validator.New().Struct(req)
v := web.NewValidator()
err := v.Struct(req)
if err != nil {
return Token{}, err
}