MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / ValidateContext

Method ValidateContext

pkg/account/user.go:83–93  ·  view source on GitHub ↗

ValidateContext validates the login request.

(ctx context.Context)

Source from the content-addressed store, hash-verified

81
82// ValidateContext validates the login request.
83func (req *loginRequest) ValidateContext(ctx context.Context) error {
84 if strings.TrimSpace(req.UserID) == "" {
85 return errMissingUserID.New()
86 }
87 if strings.TrimSpace(req.Password) == "" {
88 return errMissingPassword.New()
89 }
90 return (&ttnpb.UserIdentifiers{
91 UserId: req.UserID,
92 }).ValidateFields("user_id")
93}
94
95var errParse = errors.DefineAborted("parse", "request body parsing")
96

Callers 4

LoginMethod · 0.95
handleDownMethod · 0.45
GetMethod · 0.45
SetMethod · 0.45

Calls 2

NewMethod · 0.65
ValidateFieldsMethod · 0.45

Tested by

no test coverage detected