License expired notice is not showing up for users
Created by: unknwon
Originally reported by @dadlerj, on an instance with expired license, only site-admin sees the banner about license expiration but no users had seen the following page:
It turns out as of now, the whole PostAuthMiddleware
handler is not working as intended for two reasons:
-
err != nil
indicates the current user is not a site-admin, the logic and comments are having conflict of interests. - The handler is not able to actually identify if the authenticated user is a site admin (because if it works correctly, the site admins should have been prevented from login after the license expired). The
r.Context()
does not carry authenticated user information in it (error is "not authenticated" even for a site admin).