}
type tokenResult struct {
- valid bool
lastLookup time.Time
}
if strings.HasPrefix(req.URL.Path, "/dashboard/") || req.URL.Path == "/dashboard" {
return req.WithContext(ctx), nil
}
+ // Adding this workaround for Equity Playground.
+ if strings.HasPrefix(req.URL.Path, "/equity/") || req.URL.Path == "/equity" {
+ return req.WithContext(ctx), nil
+ }
if loopbackOn && local {
return req.WithContext(ctx), nil
}
res, ok := a.tokenMap[user+pw]
a.tokenMu.Unlock()
if !ok || time.Now().After(res.lastLookup.Add(tokenExpiry)) {
- valid, err := a.tokens.Check(ctx, user, pw)
- if err != nil || !valid {
+ err := a.tokens.Check(user, pw)
+ if err != nil {
return ErrInvalidToken
}
- res = tokenResult{valid: valid, lastLookup: time.Now()}
+ res = tokenResult{lastLookup: time.Now()}
a.tokenMu.Lock()
a.tokenMap[user+pw] = res
a.tokenMu.Unlock()