diff --git a/share/jupyterhub/static/js/token.js b/share/jupyterhub/static/js/token.js
index 2a0e3f7e..3022a3f2 100644
--- a/share/jupyterhub/static/js/token.js
+++ b/share/jupyterhub/static/js/token.js
@@ -20,9 +20,14 @@ require(["jquery", "jhapi", "moment"], function ($, JHAPI, moment) {
if (!note.length) {
note = "Requested via token page";
}
+ var expiration_seconds =
+ parseInt($("#token-expiration-seconds").val()) || null;
api.request_token(
user,
- { note: note },
+ {
+ note: note,
+ expires_in: expiration_seconds,
+ },
{
success: function (reply) {
$("#token-result").text(reply.token);
diff --git a/share/jupyterhub/templates/token.html b/share/jupyterhub/templates/token.html
index a493c8e8..aa30aa3b 100644
--- a/share/jupyterhub/templates/token.html
+++ b/share/jupyterhub/templates/token.html
@@ -19,6 +19,20 @@
This note will help you keep track of what your tokens are for.
+
+
+ {% block expiration_options %}
+
+ {% endblock expiration_options %}
+
+ You can configure when your token will be expired.
+
@@ -56,6 +70,7 @@