mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-23 00:41:33 +00:00
Create token in controller
This commit is contained in:
parent
cb46a8b80e
commit
0cd294d61f
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user