Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit a000f94

Browse files
committed
Fix import cycle.
1 parent 14e0909 commit a000f94

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

synapse/handlers/auth.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,31 @@
5353
logger = 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+
5681
class AuthHandler(BaseHandler):
5782
SESSION_EXPIRE_MS = 48 * 60 * 60 * 1000
5883

synapse/rest/client/v2_alpha/auth.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from synapse.api.constants import LoginType
1919
from synapse.api.errors import SynapseError
2020
from synapse.api.urls import CLIENT_API_PREFIX
21+
from synapse.handlers.auth import SUCCESS_TEMPLATE
2122
from synapse.http.server import finish_request
2223
from synapse.http.servlet import RestServlet, parse_string
2324

@@ -89,30 +90,6 @@
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

11794
class AuthRestServlet(RestServlet):
11895
"""

0 commit comments

Comments
 (0)