mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
sse: add auth check
This commit is contained in:
parent
af2316233a
commit
47a6006980
1 changed files with 7 additions and 2 deletions
|
@ -351,10 +351,15 @@ class _ActionsMapPlugin:
|
||||||
return m18n.g("logged_out")
|
return m18n.g("logged_out")
|
||||||
|
|
||||||
def sse(self):
|
def sse(self):
|
||||||
import time
|
|
||||||
import zmq.green as zmq
|
import zmq.green as zmq
|
||||||
|
|
||||||
# FIXME : check auth...
|
profile = request.params.get("profile", self.actionsmap.default_authentication)
|
||||||
|
authenticator = self.actionsmap.get_authenticator(profile)
|
||||||
|
|
||||||
|
try:
|
||||||
|
authenticator.get_session_cookie()
|
||||||
|
except KeyError:
|
||||||
|
raise HTTPResponse(m18n.g("not_logged_in"), 401)
|
||||||
|
|
||||||
ctx = zmq.Context()
|
ctx = zmq.Context()
|
||||||
sub = ctx.socket(zmq.SUB)
|
sub = ctx.socket(zmq.SUB)
|
||||||
|
|
Loading…
Reference in a new issue