Opened 10 years ago

Last modified 10 years ago

#933 new enhancement

Plugins should have a way to redirect to the login page

Reported by: Steve Owned by:
Priority: minor Milestone:
Component: programming Keywords: plugin, login
Cc: Parent Tickets:


I am writing a plugin that requires that the user be logged in before accessing the media home page. However, because I am hooking to the "media_home_context," I am only able to modify the context, which, as far as I can tell cannot cause a redirect. The only way that I can see to do this redirect currently is to raise an exception that is handled by forwarding the user to the login page, but I could not find an appropriate existing exception.

A 401 error may be appropriate, but according to RFC 7235, the server must send a WWW-Authenticate Header if it responds with a 401 error, which does not make sense since MediaGoblin uses a login page.

Please forgive me if this functionality already exists and I missed it.

Change History (1)

comment:1 by Steve, 10 years ago

I can work on this if someone has a suggestion on how to provide this functionality.

Note: See TracTickets for help on using tickets.