mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 04:14:59 +00:00
fix(subscription): harden quantity updates and proxy trust behavior
Centralize min/max server limits in Stripe quantity updates and wire them into Livewire subscription actions with price preview/update handling. Also improve host/proxy middleware behavior by trusting loopback hosts when FQDN is set and auto-enabling secure session cookies for HTTPS requests behind proxies when session.secure is unset. Includes feature tests for loopback trust and secure cookie auto-detection.
This commit is contained in:
1 parent
76ae720c36
commit
d3b8d70f08
9 files changed
+423
-99
No files matched your search
@@ -20,6 +20,20 @@ class Subscription extends Model
|
||||
return $this->belongsTo(Team::class);
|
||||
}
|
||||
|
||||
public function billingInterval(): string
|
||||
{
|
||||
if ($this->stripe_plan_id) {
|
||||
$configKey = collect(config('subscription'))
|
||||
->search($this->stripe_plan_id);
|
||||
|
||||
if ($configKey && str($configKey)->contains('yearly')) {
|
||||
return 'yearly';
|
||||
}
|
||||
}
|
||||
|
||||
return 'monthly';
|
||||
}
|
||||
|
||||
public function type()
|
||||
{
|
||||
if (isStripe()) {
|
||||
|
||||
Reference in new issue
Block a user