1
1
{% extends "page.html" %}
2
2
3
+ {% block stylesheet %}
4
+ < style >
5
+ .form {
6
+ margin-left : 50px ;
7
+ margin-right : 50px ;
8
+ }
9
+
10
+ .content {
11
+ margin-left : 50px ;
12
+ margin-right : 50px ;
13
+ margin-bottom : 50px ;
14
+ }
15
+ </ style >
16
+ {% endblock %}
17
+
3
18
{% block site %}
4
19
{% if message %}
5
20
{% for key in message %}
6
- < div >
21
+ < div class =" content " >
7
22
{{message[key]}}
8
23
</ div >
9
24
{% endfor %}
10
25
{% endif %}
11
- < form action ="{{base_url}}login?next={{next}} " method ="post ">
26
+ < form class =" form " action ="{{base_url}}login?next={{next}} " method ="post ">
12
27
{{ xsrf_form_html() | safe }}
13
- < label for ="password_input "> < strong > {% trans %}Password:{% endtrans %}</ strong > </ label >
28
+ < label for ="password_input "> < strong > {% trans %}Password or token :{% endtrans %}</ strong > </ label >
14
29
< input type ="password " name ="password " id ="password_input ">
15
30
< button type ="submit " id ="login_submit "> {% trans %}Log in{% endtrans %}</ button >
16
31
</ form >
17
- {% endblock site %}
32
+
33
+ {% if token_available %}
34
+ {% block token_message %}
35
+ < div class ="content ">
36
+ < h3 >
37
+ Token authentication is enabled
38
+ </ h3 >
39
+ < p >
40
+ If no password has been configured, you need to open the
41
+ server with its login token in the URL, or paste it above.
42
+ This requirement will be lifted if you
43
+ < b > < a href ='https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html '>
44
+ enable a password</ a > </ b > .
45
+ </ p >
46
+ < p >
47
+ The command:
48
+ < pre > jupyter server list</ pre >
49
+ will show you the URLs of running servers with their tokens,
50
+ which you can copy and paste into your browser. For example:
51
+ </ p >
52
+ < pre > Currently running servers:
53
+ http://localhost:8888/?token=c8de56fa... :: /Users/you/notebooks
54
+ </ pre >
55
+ < p >
56
+ or you can paste just the token value into the password field on this
57
+ page.
58
+ </ p >
59
+ < p >
60
+ See
61
+ < b > < a href ='https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html '>
62
+ the documentation on how to enable a password</ a >
63
+ </ b >
64
+ in place of token authentication,
65
+ if you would like to avoid dealing with random tokens.
66
+ </ p >
67
+ < p >
68
+ Cookies are required for authenticated access to notebooks.
69
+ </ p >
70
+ {% if allow_password_change %}
71
+ < h3 > {% trans %}Setup a Password{% endtrans %}</ h3 >
72
+ < p > You can also setup a password by entering your token and a new password
73
+ on the fields below:</ p >
74
+ < form action ="{{base_url}}login?next={{next}} " method ="post " class ="">
75
+ {{ xsrf_form_html() | safe }}
76
+ < div class ="form-group ">
77
+ < label for ="token_input ">
78
+ < h4 > Token</ h4 >
79
+ </ label >
80
+ < input type ="password " name ="password " id ="token_input " class ="form-control ">
81
+ </ div >
82
+ < div class ="form-group ">
83
+ < label for ="new_password_input ">
84
+ < h4 > New Password</ h4 >
85
+ </ label >
86
+ < input type ="password " name ="new_password " id ="new_password_input " class ="form-control " required >
87
+ </ div >
88
+ < div class ="form-group ">
89
+ < button type ="submit " class ="btn btn-default " id ="login_new_pass_submit "> {% trans %}Log in and set new
90
+ password{% endtrans %}</ button >
91
+ </ div >
92
+ </ form >
93
+ {% endif %}
94
+ </ div >
95
+ {% endblock token_message %}
96
+ {% endif %}
97
+
98
+ {% endblock site %}
0 commit comments