Commit bb22427

Eric Bower  ·  2025-12-04 22:36:54 -0500 EST
parent 68e1ece
fix(auth): don't extend a pico+ sub by a year if it is expired
1 files changed,  +3, -1
+3, -1
......@@ -1756,7 +1756,9 @@ func (me *PsqlDB) RemoveFeature(userID string, name string) error {
17561756
17571757 func (me *PsqlDB) createFeatureExpiresAt(userID, name string) time.Time {
17581758 ff, _ := me.FindFeature(userID, name)
1759- if ff == nil {
1759+ // if the feature flag has already expired we don't want to add a year to it since that will
1760+ // not grant the user a full year
1761+ if ff == nil || !ff.IsValid() {
17601762 t := time.Now()
17611763 return t.AddDate(1, 0, 0)
17621764 }