summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/access.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/access.go')
-rw-r--r--vendor/github.com/mattermost/platform/model/access.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/vendor/github.com/mattermost/platform/model/access.go b/vendor/github.com/mattermost/platform/model/access.go
index 9e16ed58..551ef930 100644
--- a/vendor/github.com/mattermost/platform/model/access.go
+++ b/vendor/github.com/mattermost/platform/model/access.go
@@ -6,6 +6,7 @@ package model
import (
"encoding/json"
"io"
+ "net/http"
)
const (
@@ -37,23 +38,23 @@ type AccessResponse struct {
func (ad *AccessData) IsValid() *AppError {
if len(ad.ClientId) == 0 || len(ad.ClientId) > 26 {
- return NewLocAppError("AccessData.IsValid", "model.access.is_valid.client_id.app_error", nil, "")
+ return NewAppError("AccessData.IsValid", "model.access.is_valid.client_id.app_error", nil, "", http.StatusBadRequest)
}
if len(ad.UserId) == 0 || len(ad.UserId) > 26 {
- return NewLocAppError("AccessData.IsValid", "model.access.is_valid.user_id.app_error", nil, "")
+ return NewAppError("AccessData.IsValid", "model.access.is_valid.user_id.app_error", nil, "", http.StatusBadRequest)
}
if len(ad.Token) != 26 {
- return NewLocAppError("AccessData.IsValid", "model.access.is_valid.access_token.app_error", nil, "")
+ return NewAppError("AccessData.IsValid", "model.access.is_valid.access_token.app_error", nil, "", http.StatusBadRequest)
}
if len(ad.RefreshToken) > 26 {
- return NewLocAppError("AccessData.IsValid", "model.access.is_valid.refresh_token.app_error", nil, "")
+ return NewAppError("AccessData.IsValid", "model.access.is_valid.refresh_token.app_error", nil, "", http.StatusBadRequest)
}
if len(ad.RedirectUri) == 0 || len(ad.RedirectUri) > 256 || !IsValidHttpUrl(ad.RedirectUri) {
- return NewLocAppError("AccessData.IsValid", "model.access.is_valid.redirect_uri.app_error", nil, "")
+ return NewAppError("AccessData.IsValid", "model.access.is_valid.redirect_uri.app_error", nil, "", http.StatusBadRequest)
}
return nil