feat(identity): confirm registration email atomically
This commit is contained in:
1 parent
8e7ce8d71c
commit
fade4e76e4
75 files changed
+4188
-403
No files matched your search
@@ -102,6 +102,7 @@ type RegistrationDependencies struct {
|
||||
const (
|
||||
ScopeAddress = "address"
|
||||
ScopeClient = "client"
|
||||
ScopeToken = "token"
|
||||
)
|
||||
|
||||
// RateLimitMetrics counts refused requests by scope, never by address.
|
||||
@@ -319,7 +320,7 @@ func (registration *Registration) createAccount(ctx context.Context, unit outbou
|
||||
if err := unit.Users().Create(ctx, user); err != nil {
|
||||
return fmt.Errorf("%s - store account: %w", location, err)
|
||||
}
|
||||
if _, err := registration.deps.Consents.GrantAtRegistration(ctx, unit, user.ID, input.version); err != nil {
|
||||
if _, err := registration.deps.Consents.GrantAtRegistration(ctx, unit, user.ID, user.RegistrationVersion, input.version); err != nil {
|
||||
return fmt.Errorf("%s - record C1: %w", location, err)
|
||||
}
|
||||
pending, err := domain.NewPendingRegistration(input.hash, input.scenario)
|
||||
@@ -353,7 +354,7 @@ func (registration *Registration) reRegister(
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s - advance registration: %w", location, err)
|
||||
}
|
||||
if _, err := registration.deps.Consents.GrantAtRegistration(ctx, unit, advanced.ID, input.version); err != nil {
|
||||
if _, err := registration.deps.Consents.GrantAtRegistration(ctx, unit, advanced.ID, advanced.RegistrationVersion, input.version); err != nil {
|
||||
return fmt.Errorf("%s - record C1: %w", location, err)
|
||||
}
|
||||
pending, err := domain.NewPendingRegistration(input.hash, input.scenario)
|
||||
|
||||
Reference in new issue
Block a user