Skip to content

Commit e7c7588

Browse files
authored
Merge pull request #88 from tstromberg/reliable
auto-close the auth window
2 parents a8cd4f7 + f726244 commit e7c7588

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

pkg/slack/oauth.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,23 @@ func (*OAuthHandler) writeSuccessPage(writer http.ResponseWriter, teamName strin
342342
<a href="https://github.com/codeGROOVE-dev/slacker/blob/main/docs/SETUP.md#configuring-your-repositories"
343343
target="_blank"
344344
rel="noopener noreferrer">Configure your repositories</a></p>
345-
<p class="footer">Then close this window and return to Slack.</p>
345+
<p class="footer">This window will close automatically in <span id="countdown">3</span> seconds.</p>
346346
</div>
347347
</main>
348+
<script>
349+
(function() {
350+
var seconds = 3;
351+
var countdown = document.getElementById('countdown');
352+
var timer = setInterval(function() {
353+
seconds--;
354+
if (countdown) countdown.textContent = seconds;
355+
if (seconds <= 0) {
356+
clearInterval(timer);
357+
window.close();
358+
}
359+
}, 1000);
360+
})();
361+
</script>
348362
</body>
349363
</html>
350364
`, teamName); err != nil {

0 commit comments

Comments
 (0)