Merge commit from fork

When an expired invite code was used for webauthn (passkeys), the change date got updated by the failed event. This change date was used to test for expiry, meaning failed events would reset the expiry timeout.

This fix adds a Code Creation Date to the writemodel which gets set by the first event. This can be the added or requested event.

Other changes:

- Expiry renamed to CodeExpiry so it's consistent with similar write models using secret codes.
- humanVerifyPasswordlessInitCode takes an algorithm instead of the complete generator, so the method can be unit tested easier
- Added tests that reproduced the original issue
This commit is contained in:
Tim Möhlmann
2026-03-11 08:25:21 +01:00
committed by GitHub
parent 4a8a5e2fef
commit 64ee480f84
7 changed files with 264 additions and 14 deletions
+5 -1
View File
@@ -158,8 +158,12 @@ func eventFromEventPusherWithInstanceID(instanceID string, event eventstore.Comm
}
func eventFromEventPusherWithCreationDateNow(event eventstore.Command) *repository.Event {
return eventFromEventPusherWithCreationDate(event, time.Now())
}
func eventFromEventPusherWithCreationDate(event eventstore.Command, creationDate time.Time) *repository.Event {
e := eventFromEventPusher(event)
e.CreationDate = time.Now()
e.CreationDate = creationDate
return e
}