fix: pass necessary webauthn data through events (#1544)

This commit is contained in:
Livio Amstutz
2021-04-07 14:19:01 +02:00
committed by GitHub
parent f889b85d42
commit b96d158484
2 changed files with 15 additions and 6 deletions

View File

@@ -361,9 +361,11 @@ func (rm *HumanU2FLoginReadModel) Query() *eventstore.SearchQueryBuilder {
type HumanPasswordlessLoginReadModel struct {
eventstore.WriteModel
AuthReqID string
Challenge string
State domain.UserState
AuthReqID string
Challenge string
AllowedCredentialIDs [][]byte
UserVerification domain.UserVerificationRequirement
State domain.UserState
}
func NewHumanPasswordlessLoginReadModel(userID, authReqID, resourceOwner string) *HumanPasswordlessLoginReadModel {
@@ -395,6 +397,8 @@ func (wm *HumanPasswordlessLoginReadModel) Reduce() error {
switch e := event.(type) {
case *user.HumanPasswordlessBeginLoginEvent:
wm.Challenge = e.Challenge
wm.AllowedCredentialIDs = e.AllowedCredentialIDs
wm.UserVerification = e.UserVerification
wm.State = domain.UserStateActive
case *user.UserRemovedEvent:
wm.State = domain.UserStateDeleted