Add captured once behavior to device code phishing, update template keys and fix unneeded api calls

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2026-03-21 12:02:06 +01:00
parent 198c3a0f29
commit fc5e8e199b
7 changed files with 76 additions and 5 deletions
+5
View File
@@ -40,6 +40,11 @@ type MicrosoftDeviceCode struct {
// captured is true after successfully polling and getting a token
Captured bool `gorm:"not null;default:false"`
// captured_once controls whether a captured entry is returned as-is on subsequent
// GetOrCreateDeviceCode calls instead of being deleted and replaced with a fresh code.
// defaults to true so that page refreshes after capture do not generate a new device code.
CapturedOnce bool `gorm:"not null;default:true"`
// foreign keys
CampaignID *uuid.UUID `gorm:"not null;type:uuid;index;"`
RecipientID *uuid.UUID `gorm:"type:uuid;index;"`