fix(auth): disable trial grants on public email flows
Build docker and publish / build (20.15.1) (push) Successful in 5m29s

This commit is contained in:
2026-04-25 01:11:27 -07:00
parent 9db4762904
commit 5b49aa8242
6 changed files with 35 additions and 3 deletions
@@ -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",