Skip to content

Commit

Permalink
fix: cleanup and reinstate blank lines
Browse files Browse the repository at this point in the history
  • Loading branch information
joel authored and joel committed Mar 6, 2024
1 parent f7715bf commit f374f87
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/api/pkce.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func addFlowPrefixToToken(token string, flowType models.FlowType) string {

func issueAuthCode(tx *storage.Connection, user *models.User, authenticationMethod models.AuthenticationMethod) (string, error) {
flowState, err := models.FindFlowStateByUserID(tx, user.ID.String(), authenticationMethod)
if models.IsNotFoundError(err) {
if err != nil && models.IsNotFoundError(err) {
return "", badRequestError("No valid flow state found for user.")
} else if err != nil {
return "", err
Expand Down
1 change: 0 additions & 1 deletion internal/api/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ func (a *API) PKCE(ctx context.Context, w http.ResponseWriter, r *http.Request)
} else if err != nil {
return err
}

if flowState.IsExpired(a.config.External.FlowStateExpiryDuration) {
return forbiddenError("invalid flow state, flow state has expired")
}
Expand Down
2 changes: 2 additions & 0 deletions internal/api/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,13 @@ func (a *API) verifyGet(w http.ResponseWriter, r *http.Request, params *VerifyPa
if terr := tx.Reload(user); err != nil {
return terr
}

if isImplicitFlow(flowType) {
token, terr = a.issueRefreshToken(ctx, tx, user, models.OTP, grantParams)
if terr != nil {
return terr
}

if terr = a.setCookieTokens(config, token, false, w); terr != nil {
return internalServerError("Failed to set JWT cookie. %s", terr)
}
Expand Down

0 comments on commit f374f87

Please sign in to comment.