Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ActorEmail": "john@cyberdyne.io",
"ActorName": "John Connor",
"OrgID": "1089bb36-e27b-428b-8009-d015c8737c54",
"Description": "john@cyberdyne.io has logged in",
"Description": "John Connor has logged in",
"Info": {
"user_id": "1089bb36-e27b-428b-8009-d015c8737c54",
"email": "john@cyberdyne.io",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ActorEmail": "john@cyberdyne.io",
"ActorName": "John Connor",
"OrgID": "1089bb36-e27b-428b-8009-d015c8737c54",
"Description": "john@cyberdyne.io has signed up",
"Description": "John Connor has signed up",
"Info": {
"user_id": "1089bb36-e27b-428b-8009-d015c8737c54",
"email": "john@cyberdyne.io"
Expand Down
4 changes: 2 additions & 2 deletions app/controlplane/pkg/auditor/events/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (p *UserSignedUp) ActionType() string {
}

func (p *UserSignedUp) Description() string {
return fmt.Sprintf("%s has signed up", p.Email)
return fmt.Sprintf("%s has signed up", auditor.GetActorIdentifier())
}

type UserLoggedIn struct {
Expand All @@ -87,7 +87,7 @@ func (p *UserLoggedIn) ActionType() string {
}

func (p *UserLoggedIn) Description() string {
return fmt.Sprintf("%s has logged in", p.Email)
return fmt.Sprintf("%s has logged in", auditor.GetActorIdentifier())
}

func (p *UserLoggedIn) ActionInfo() (json.RawMessage, error) {
Expand Down
4 changes: 2 additions & 2 deletions app/controlplane/pkg/biz/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (uc *UserUseCase) UpsertByEmail(ctx context.Context, email string, opts *Up
}

// set the context user so it can be used in the auditor
ctx = entities.WithCurrentUser(ctx, &entities.User{Email: u.Email, ID: u.ID})
ctx = entities.WithCurrentUser(ctx, &entities.User{Email: u.Email, ID: u.ID, FirstName: u.FirstName, LastName: u.LastName})
uc.auditorUC.Dispatch(ctx, &events.UserSignedUp{
UserBase: &events.UserBase{
UserID: ToPtr(uuid.MustParse(u.ID)),
Expand All @@ -155,7 +155,7 @@ func (uc *UserUseCase) UpsertByEmail(ctx context.Context, email string, opts *Up
}, nil)
} else {
// Login case
ctx = entities.WithCurrentUser(ctx, &entities.User{Email: u.Email, ID: u.ID})
ctx = entities.WithCurrentUser(ctx, &entities.User{Email: u.Email, ID: u.ID, FirstName: u.FirstName, LastName: u.LastName})
uc.auditorUC.Dispatch(ctx, &events.UserLoggedIn{
UserBase: &events.UserBase{
UserID: ToPtr(uuid.MustParse(u.ID)),
Expand Down
Loading