Function
deleteTokenFromStorage
(c fiber.Ctx, token string, cfg *Config, sessionManager *sessionManager, storageManager *storageManager)
Source from the content-addressed store, hash-verified
| 286 | } |
| 287 | |
| 288 | func deleteTokenFromStorage(c fiber.Ctx, token string, cfg *Config, sessionManager *sessionManager, storageManager *storageManager) error { |
| 289 | if cfg.Session != nil { |
| 290 | sessionManager.delRaw(c) |
| 291 | return nil |
| 292 | } |
| 293 | if err := storageManager.delRaw(c, token); err != nil { |
| 294 | return fmt.Errorf("csrf: failed to delete token from storage: %w", err) |
| 295 | } |
| 296 | return nil |
| 297 | } |
| 298 | |
| 299 | // Update CSRF cookie |
| 300 | // if expireCookie is true, the cookie will expire immediately |