mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-04-12 00:37:56 +00:00
fix: revoke access token on duplicate auth code user
This commit is contained in:
@@ -275,6 +275,9 @@ func (controller *OIDCController) Token(c *gin.Context) {
|
||||
case "authorization_code":
|
||||
entry, err := controller.oidc.GetCodeEntry(c, controller.oidc.Hash(req.Code), client.ClientID)
|
||||
if err != nil {
|
||||
// Delete the access token just in case
|
||||
controller.oidc.DeleteTokenByCodeHash(c, controller.oidc.Hash(req.Code))
|
||||
|
||||
if errors.Is(err, service.ErrCodeNotFound) {
|
||||
tlog.App.Warn().Msg("Code not found")
|
||||
c.JSON(400, gin.H{
|
||||
|
||||
Reference in New Issue
Block a user