Permalink
Browse files

fix some linter warning

  • Loading branch information...
Asaduzzaman Pavel
Asaduzzaman Pavel committed Oct 18, 2018
1 parent 2cdcf43 commit d7772d7e49b9bbded9fedf7c6adec744f1646faf
Showing with 9 additions and 8 deletions.
  1. +1 −1 api/errors.go
  2. +2 −2 api/external.go
  3. +1 −1 api/external_oauth.go
  4. +1 −1 api/hooks.go
  5. +1 −1 api/invite.go
  6. +2 −2 api/signup.go
  7. +1 −0 api/token.go
View
@@ -8,7 +8,7 @@ import (
"runtime/debug"
)
var oauthErrorMap map[int]string = map[int]string{
var oauthErrorMap = map[int]string{
http.StatusBadRequest: "invalid_request",
http.StatusUnauthorized: "unauthorized_client",
http.StatusForbidden: "access_denied",
View
@@ -96,7 +96,7 @@ func (a *API) internalExternalProviderCallback(w http.ResponseWriter, r *http.Re
}
userData = samlUserData
} else {
oAuthUserData, err := a.oAuthCallback(r, ctx, providerType)
oAuthUserData, err := a.oAuthCallback(ctx, r, providerType)
if err != nil {
return err
}
@@ -135,7 +135,7 @@ func (a *API) internalExternalProviderCallback(w http.ResponseWriter, r *http.Re
}
}
user, terr = a.signupNewUser(tx, ctx, params)
user, terr = a.signupNewUser(ctx, tx, params)
if terr != nil {
return terr
}
View
@@ -20,7 +20,7 @@ func (a *API) loadOAuthState(w http.ResponseWriter, r *http.Request) (context.Co
return a.loadExternalState(ctx, state)
}
func (a *API) oAuthCallback(r *http.Request, ctx context.Context, providerType string) (*provider.UserProvidedData, error) {
func (a *API) oAuthCallback(ctx context.Context, r *http.Request, providerType string) (*provider.UserProvidedData, error) {
rq := r.URL.Query()
extError := rq.Get("error")
View
@@ -34,7 +34,7 @@ const (
LoginEvent = "login"
)
var defaultTimeout time.Duration = time.Second * 5
var defaultTimeout = time.Second * 5
type webhookClaims struct {
jwt.StandardClaims
View
@@ -47,7 +47,7 @@ func (a *API) Invite(w http.ResponseWriter, r *http.Request) error {
Aud: aud,
Provider: "email",
}
user, err = a.signupNewUser(tx, ctx, &signupParams)
user, err = a.signupNewUser(ctx, tx, &signupParams)
if err != nil {
return err
}
View
@@ -60,7 +60,7 @@ func (a *API) Signup(w http.ResponseWriter, r *http.Request) error {
}
} else {
params.Provider = "email"
user, terr = a.signupNewUser(tx, ctx, params)
user, terr = a.signupNewUser(ctx, tx, params)
if terr != nil {
return terr
}
@@ -93,7 +93,7 @@ func (a *API) Signup(w http.ResponseWriter, r *http.Request) error {
return sendJSON(w, http.StatusOK, user)
}
func (a *API) signupNewUser(conn *storage.Connection, ctx context.Context, params *SignupParams) (*models.User, error) {
func (a *API) signupNewUser(ctx context.Context, conn *storage.Connection, params *SignupParams) (*models.User, error) {
instanceID := getInstanceID(ctx)
config := a.getConfig(ctx)
View
@@ -12,6 +12,7 @@ import (
"github.com/netlify/gotrue/storage"
)
// GoTrueClaims is a struct thats used for JWT claims
type GoTrueClaims struct {
jwt.StandardClaims
Email string `json:"email"`

0 comments on commit d7772d7

Please sign in to comment.