We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1633424 commit 3fbcd7bCopy full SHA for 3fbcd7b
reflex_azure_auth/funcs.py
@@ -0,0 +1,15 @@
1
+"""Javascript functions for working with the browser."""
2
+
3
+from reflex.vars import Var
4
+from reflex.vars.function import ArgsFunctionOperation, FunctionStringVar
5
6
+WINDOW_OPEN = FunctionStringVar.create("window.open")
7
+POST_MESSAGE_AND_CLOSE_POPUP = ArgsFunctionOperation.create(
8
+ ("payload", "origin", "close_timeout"),
9
+ return_expr=Var("""{
10
+ if (window.opener && window.opener.origin === origin) {
11
+ window.opener.postMessage(payload, origin);
12
+ setTimeout(() => window.close(), close_timeout);
13
+ }
14
+ }"""),
15
+)
0 commit comments