This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-24
lines changed Expand file tree Collapse file tree 2 files changed +26
-24
lines changed Original file line number Diff line number Diff line change 5353logger = logging .getLogger (__name__ )
5454
5555
56+ SUCCESS_TEMPLATE = """
57+ <html>
58+ <head>
59+ <title>Success!</title>
60+ <meta name='viewport' content='width=device-width, initial-scale=1,
61+ user-scalable=no, minimum-scale=1.0, maximum-scale=1.0'>
62+ <link rel="stylesheet" href="/_matrix/static/client/register/style.css">
63+ <script>
64+ if (window.onAuthDone) {
65+ window.onAuthDone();
66+ } else if (window.opener && window.opener.postMessage) {
67+ window.opener.postMessage("authDone", "*");
68+ }
69+ </script>
70+ </head>
71+ <body>
72+ <div>
73+ <p>Thank you</p>
74+ <p>You may now close this window and return to the application</p>
75+ </div>
76+ </body>
77+ </html>
78+ """
79+
80+
5681class AuthHandler (BaseHandler ):
5782 SESSION_EXPIRE_MS = 48 * 60 * 60 * 1000
5883
Original file line number Diff line number Diff line change 1818from synapse .api .constants import LoginType
1919from synapse .api .errors import SynapseError
2020from synapse .api .urls import CLIENT_API_PREFIX
21+ from synapse .handlers .auth import SUCCESS_TEMPLATE
2122from synapse .http .server import finish_request
2223from synapse .http .servlet import RestServlet , parse_string
2324
8990</html>
9091"""
9192
92- SUCCESS_TEMPLATE = """
93- <html>
94- <head>
95- <title>Success!</title>
96- <meta name='viewport' content='width=device-width, initial-scale=1,
97- user-scalable=no, minimum-scale=1.0, maximum-scale=1.0'>
98- <link rel="stylesheet" href="/_matrix/static/client/register/style.css">
99- <script>
100- if (window.onAuthDone) {
101- window.onAuthDone();
102- } else if (window.opener && window.opener.postMessage) {
103- window.opener.postMessage("authDone", "*");
104- }
105- </script>
106- </head>
107- <body>
108- <div>
109- <p>Thank you</p>
110- <p>You may now close this window and return to the application</p>
111- </div>
112- </body>
113- </html>
114- """
115-
11693
11794class AuthRestServlet (RestServlet ):
11895 """
You can’t perform that action at this time.
0 commit comments