Skip to content
Snippets Groups Projects
Commit 3a8310ae authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

error if ST would already be expired

parent 5d483eb2
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import (
"fmt"
"log"
"strings"
"time"
"github.com/zachmann/mytoken/internal/supertoken/restrictions"
......@@ -111,6 +112,12 @@ func InitAuthCodeFlow(body []byte) model.Response {
Response: model.APIErrorUnknownIssuer,
}
}
if req.Restrictions.GetExpires() < time.Now().Unix() {
return model.Response{
Status: fiber.StatusBadRequest,
Response: model.BadRequestError("token would already be expired"),
}
}
authURL, state := authorizationURL(provider, req.Restrictions, req.Native())
authFlowInfo := dbModels.AuthFlowInfo{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment