Create token in controller

This commit is contained in:
Bálint Bokros 2018-02-13 13:35:34 +01:00
parent cb46a8b80e
commit 0cd294d61f

View File

@ -1,3 +1,4 @@
import secrets
from tornado.ioloop import IOLoop from tornado.ioloop import IOLoop
from tornado.web import Application from tornado.web import Application
@ -10,10 +11,13 @@ from tfw.config.logs import logging
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
if __name__ == '__main__': if __name__ == '__main__':
solvable_connector = AsyncSolvableConnector() kwargs = {
'solvable_connector': AsyncSolvableConnector(),
'token': secrets.token_hex(32)
}
routes = [ routes = [
(r'/{secret}/?'.format(secret=taoenv.SECRET), SolutionCheckHandler, {'solvable_connector': solvable_connector}), (r'/{secret}/?'.format(secret=taoenv.SECRET), SolutionCheckHandler, kwargs),
(r'/{secret}/test/?'.format(secret=taoenv.SECRET), TestHandler, {'solvable_connector': solvable_connector}) (r'/{secret}/test/?'.format(secret=taoenv.SECRET), TestHandler, kwargs)
] ]
app = Application( app = Application(
routes routes