fix(auth): disable trial grants on public email flows
Build docker and publish / build (20.15.1) (push) Successful in 5m29s
Build docker and publish / build (20.15.1) (push) Successful in 5m29s
This commit is contained in:
@@ -14,6 +14,13 @@ import (
|
||||
|
||||
func tryGrantTrialOnEmailBind(ctx context.Context, svcCtx *svc.ServiceContext, log logger.Logger, ownerUserId int64, email string) {
|
||||
rc := svcCtx.Config.Register
|
||||
if !auth.ShouldAutoGrantTrialOnPublicEmailFlows(rc) {
|
||||
log.Infow("auto trial on email flow disabled, skip",
|
||||
logger.Field("email", email),
|
||||
logger.Field("owner_user_id", ownerUserId),
|
||||
)
|
||||
return
|
||||
}
|
||||
if !auth.ShouldGrantTrialForEmail(rc, email) {
|
||||
if rc.EnableTrial && rc.EnableTrialEmailWhitelist {
|
||||
log.Infow("email domain not in trial whitelist, skip",
|
||||
|
||||
Reference in New Issue
Block a user