Fix sign up and accept invite
Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
@@ -257,6 +257,19 @@ func (s *AccountService) AcceptInvitation(
|
||||
return fmt.Errorf("cannot create membership: %w", err)
|
||||
}
|
||||
|
||||
profile := &coredata.MembershipProfile{
|
||||
ID: gid.New(tenantID, coredata.MembershipProfileEntityType),
|
||||
MembershipID: membership.ID,
|
||||
FullName: identity.FullName,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
}
|
||||
|
||||
err = profile.Insert(ctx, tx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert profile: %w", err)
|
||||
}
|
||||
|
||||
invitation.AcceptedAt = &now
|
||||
err = invitation.Update(ctx, tx, scope)
|
||||
if err != nil {
|
||||
|
||||
@@ -425,7 +425,10 @@ func (s *OrganizationService) InviteMember(
|
||||
return fmt.Errorf("cannot parse base URL: %w", err)
|
||||
}
|
||||
|
||||
invitationURL := baseurl.WithPath("/auth/signup-from-invitation").WithQuery("token", invitationToken).MustString()
|
||||
invitationURL := baseurl.WithPath("/auth/signup-from-invitation").
|
||||
WithQuery("token", invitationToken).
|
||||
WithQuery("fullName", invitation.FullName).
|
||||
MustString()
|
||||
|
||||
subject, textBody, htmlBody, err := emails.RenderInvitation(
|
||||
s.baseURL,
|
||||
|
||||
Reference in New Issue
Block a user