mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
fix: ignore otp.verified v1 event for usersessions (#1633)
* remove MFAOTPVerified from user session projection * add tracing for VerifyOIDCClientSecret in commands * fix test
This commit is contained in:
parent
c919fd6f13
commit
3f90d620b8
@ -170,7 +170,10 @@ func (c *Commands) ChangeOIDCApplicationSecret(ctx context.Context, projectID, a
|
|||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commands) VerifyOIDCClientSecret(ctx context.Context, projectID, appID, secret string) error {
|
func (c *Commands) VerifyOIDCClientSecret(ctx context.Context, projectID, appID, secret string) (err error) {
|
||||||
|
ctx, span := tracing.NewSpan(ctx)
|
||||||
|
defer func() { span.EndWithError(err) }()
|
||||||
|
|
||||||
app, err := c.getOIDCAppWriteModel(ctx, projectID, appID, "")
|
app, err := c.getOIDCAppWriteModel(ctx, projectID, appID, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -120,8 +120,7 @@ func (v *UserSessionView) AppendEvent(event *models.Event) error {
|
|||||||
if v.UserAgentID != data.UserAgentID {
|
if v.UserAgentID != data.UserAgentID {
|
||||||
v.PasswordVerification = time.Time{}
|
v.PasswordVerification = time.Time{}
|
||||||
}
|
}
|
||||||
case es_model.MFAOTPVerified,
|
case es_model.HumanMFAOTPVerified:
|
||||||
es_model.HumanMFAOTPVerified:
|
|
||||||
data := new(es_model.OTPVerified)
|
data := new(es_model.OTPVerified)
|
||||||
err := data.SetData(event)
|
err := data.SetData(event)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -119,7 +119,7 @@ func TestAppendEvent(t *testing.T) {
|
|||||||
args: args{
|
args: args{
|
||||||
event: &es_models.Event{
|
event: &es_models.Event{
|
||||||
CreationDate: now(),
|
CreationDate: now(),
|
||||||
Type: es_model.MFAOTPVerified,
|
Type: es_model.HumanMFAOTPVerified,
|
||||||
Data: nil,
|
Data: nil,
|
||||||
},
|
},
|
||||||
userView: &UserSessionView{UserAgentID: "id"},
|
userView: &UserSessionView{UserAgentID: "id"},
|
||||||
@ -131,7 +131,7 @@ func TestAppendEvent(t *testing.T) {
|
|||||||
args: args{
|
args: args{
|
||||||
event: &es_models.Event{
|
event: &es_models.Event{
|
||||||
CreationDate: now(),
|
CreationDate: now(),
|
||||||
Type: es_model.MFAOTPVerified,
|
Type: es_model.HumanMFAOTPVerified,
|
||||||
Data: func() []byte {
|
Data: func() []byte {
|
||||||
d, _ := json.Marshal(&es_model.OTPVerified{
|
d, _ := json.Marshal(&es_model.OTPVerified{
|
||||||
UserAgentID: "id",
|
UserAgentID: "id",
|
||||||
|
Loading…
Reference in New Issue
Block a user