mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
fix(notification): get origin from all relevant events and fix nil pointer (#6726)
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/api/http"
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/crypto"
|
||||
@@ -279,8 +280,9 @@ func NewHumanOTPSMSRemovedEvent(
|
||||
type HumanOTPSMSCodeAddedEvent struct {
|
||||
eventstore.BaseEvent `json:"-"`
|
||||
|
||||
Code *crypto.CryptoValue `json:"code,omitempty"`
|
||||
Expiry time.Duration `json:"expiry,omitempty"`
|
||||
Code *crypto.CryptoValue `json:"code,omitempty"`
|
||||
Expiry time.Duration `json:"expiry,omitempty"`
|
||||
TriggeredAtOrigin string `json:"triggerOrigin,omitempty"`
|
||||
*AuthRequestInfo
|
||||
}
|
||||
|
||||
@@ -296,6 +298,10 @@ func (e *HumanOTPSMSCodeAddedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
||||
e.BaseEvent = *event
|
||||
}
|
||||
|
||||
func (e *HumanOTPSMSCodeAddedEvent) TriggerOrigin() string {
|
||||
return e.TriggeredAtOrigin
|
||||
}
|
||||
|
||||
func NewHumanOTPSMSCodeAddedEvent(
|
||||
ctx context.Context,
|
||||
aggregate *eventstore.Aggregate,
|
||||
@@ -309,9 +315,10 @@ func NewHumanOTPSMSCodeAddedEvent(
|
||||
aggregate,
|
||||
HumanOTPSMSCodeAddedType,
|
||||
),
|
||||
Code: code,
|
||||
Expiry: expiry,
|
||||
AuthRequestInfo: info,
|
||||
Code: code,
|
||||
Expiry: expiry,
|
||||
TriggeredAtOrigin: http.ComposedOrigin(ctx),
|
||||
AuthRequestInfo: info,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,8 +480,9 @@ func NewHumanOTPEmailRemovedEvent(
|
||||
type HumanOTPEmailCodeAddedEvent struct {
|
||||
eventstore.BaseEvent `json:"-"`
|
||||
|
||||
Code *crypto.CryptoValue `json:"code,omitempty"`
|
||||
Expiry time.Duration `json:"expiry,omitempty"`
|
||||
Code *crypto.CryptoValue `json:"code,omitempty"`
|
||||
Expiry time.Duration `json:"expiry,omitempty"`
|
||||
TriggeredAtOrigin string `json:"triggerOrigin,omitempty"`
|
||||
*AuthRequestInfo
|
||||
}
|
||||
|
||||
@@ -490,6 +498,10 @@ func (e *HumanOTPEmailCodeAddedEvent) SetBaseEvent(event *eventstore.BaseEvent)
|
||||
e.BaseEvent = *event
|
||||
}
|
||||
|
||||
func (e *HumanOTPEmailCodeAddedEvent) TriggerOrigin() string {
|
||||
return e.TriggeredAtOrigin
|
||||
}
|
||||
|
||||
func NewHumanOTPEmailCodeAddedEvent(
|
||||
ctx context.Context,
|
||||
aggregate *eventstore.Aggregate,
|
||||
@@ -503,9 +515,10 @@ func NewHumanOTPEmailCodeAddedEvent(
|
||||
aggregate,
|
||||
HumanOTPEmailCodeAddedType,
|
||||
),
|
||||
Code: code,
|
||||
Expiry: expiry,
|
||||
AuthRequestInfo: info,
|
||||
Code: code,
|
||||
Expiry: expiry,
|
||||
AuthRequestInfo: info,
|
||||
TriggeredAtOrigin: http.ComposedOrigin(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user