fix(order): reconcile subscriptions and grant device trials
Build docker and publish / build (20.15.1) (push) Has been cancelled
Build docker and publish / build (20.15.1) (push) Has been cancelled
This commit is contained in:
@@ -54,12 +54,19 @@ func ShouldGrantTrialForEmail(register config.RegisterConfig, email string) bool
|
||||
return true
|
||||
}
|
||||
|
||||
// IsTrialConfigReady verifies that trial auto-grant has all required config.
|
||||
func IsTrialConfigReady(register config.RegisterConfig) bool {
|
||||
return register.EnableTrial &&
|
||||
register.TrialSubscribe > 0 &&
|
||||
register.TrialTime > 0 &&
|
||||
strings.TrimSpace(register.TrialTimeUnit) != ""
|
||||
}
|
||||
|
||||
// ShouldAutoGrantTrialOnPublicEmailFlows defines whether browser/email-originated
|
||||
// flows may auto-create a trial subscription. The current policy disables trial
|
||||
// creation for email registration, email login auto-register, OAuth-with-email,
|
||||
// and email binding/verification to avoid abuse through public email channels.
|
||||
// flows may auto-create a trial subscription. Email-specific abuse protection
|
||||
// is still handled by ShouldGrantTrialForEmail and NormalizedEmailHasTrial.
|
||||
func ShouldAutoGrantTrialOnPublicEmailFlows(register config.RegisterConfig) bool {
|
||||
return false
|
||||
return IsTrialConfigReady(register)
|
||||
}
|
||||
|
||||
// IsDisposableAlias detects Gmail dot trick and + alias abuse.
|
||||
|
||||
Reference in New Issue
Block a user