cozy / cozy-stack

Simple, Versatile, Yours
https://docs.cozy.io/en/cozy-stack/
GNU Affero General Public License v3.0
1.13k stars 137 forks source link

fix: Redirect to clients paywall only if logged in #4386

Closed taratatach closed 5 months ago

taratatach commented 5 months ago

When an instance has more connected OAuth clients than their current plan and options allows them to, we redirect them to a paywall from any web app except the Settings app (because it allows disconnecting clients).

However, if the user is not logged in, the paywall will return an unauthorized error.

Therefore, we'll make sure the redirection to the paywall only occurs when the user is logged in (we don't duplicate the logic to redirect them to the login page in the paywall middleware).