Skip to content

Commit e333b45

Browse files
committed
Add auto-close to default landing page
Fixes #164
1 parent 717be11 commit e333b45

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

flutter_web_auth_2/lib/src/options.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,16 @@ const _defaultLandingPage = '''
3232
font-size: 2rem;
3333
}
3434
</style>
35+
<script>
36+
setTimeout(function() {
37+
window.close()
38+
}, 1);
39+
</script>
3540
</head>
3641
<body>
3742
<main>
38-
<div id="text">You may now close this page</div>
43+
<div id="text">This page should automatically close.
44+
You may also close this page manually now.</div>
3945
</main>
4046
</body>
4147
</html>
@@ -114,7 +120,7 @@ class FlutterWebAuth2Options {
114120
/// authentication process.
115121
final int timeout;
116122

117-
/// **Only has an effect on Linux and Windows!**
123+
/// **Only has an effect on Linux and Windows with [useWebview] = `false`!**
118124
/// Can be used to customise the landing page which tells the user that the
119125
/// authentication was successful. It is the literal HTML source code which
120126
/// will be displayed using a `HttpServer`.

0 commit comments

Comments
 (0)