Skip to content

Commit 0acdd39

Browse files
committed
- Add logout page and route that directs users to click the New Identity button in Tor browser to complete their session, if they were logged in, else redirectst to main source interface page.
- Remove logout_flashed message since we redirect to a new page now. - Update functional tests to include _is_on_logout_page method and replace test_logout_flashed_message with test_logout screenshot in testsourcelayout - update flashed message graphic and add login button to successful logout page (may need button alignment tweak) - Include coral-theme broom graphic and move flash-notif styling to _flash.sass - update apparmor profile to include logout.html, new assets
1 parent 1e84901 commit 0acdd39

File tree

13 files changed

+65
-29
lines changed

13 files changed

+65
-29
lines changed

install_files/ansible-base/roles/build-securedrop-app-code-deb-pkg/files/usr.sbin.apache2

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
/var/www/securedrop/source_templates/index.html r,
216216
/var/www/securedrop/source_templates/locales.html r,
217217
/var/www/securedrop/source_templates/login.html r,
218-
/var/www/securedrop/source_templates/logout_flashed_message.html r,
218+
/var/www/securedrop/source_templates/logout.html r,
219219
/var/www/securedrop/source_templates/lookup.html r,
220220
/var/www/securedrop/source_templates/next_submission_flashed_message.html r,
221221
/var/www/securedrop/source_templates/notfound.html r,
@@ -253,6 +253,7 @@
253253
/var/www/securedrop/static/i/custom_logo.png rw,
254254
/var/www/securedrop/static/i/delete_gray.png r,
255255
/var/www/securedrop/static/i/delete_red.png r,
256+
/var/www/securedrop/static/i/bang-stop.png r,
256257
/var/www/securedrop/static/i/favicon.png r,
257258
/var/www/securedrop/static/i/font-awesome/black/guard.svg r,
258259
/var/www/securedrop/static/i/font-awesome/black/times.svg r,
@@ -290,6 +291,8 @@
290291
/var/www/securedrop/static/i/tipbox/tipbox-hed-submit3.png r,
291292
/var/www/securedrop/static/i/tipbox/tipbox-hed-user.png r,
292293
/var/www/securedrop/static/i/tipbox/tipbox-logo.png r,
294+
/var/www/securedrop/static/i/torbroom-black.png r,
295+
/var/www/securedrop/static/i/torbroom-coral.png r,
293296
/var/www/securedrop/static/i/trash-x-out.png r,
294297
/var/www/securedrop/static/i/trash-x-solid.png r,
295298
/var/www/securedrop/static/i/un-star.png r,

securedrop/sass/modules/_flash.sass

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
flex-flow: row nowrap
55
align-items: flex-start
66
border-radius: 10px
7-
padding: 10px
87
margin: 10px
8+
padding: 10px
99
text-align: left
1010
font-size: medium
1111

@@ -38,11 +38,31 @@
3838
i
3939
color: #D62727
4040

41+
&.important-header
42+
margin: auto 6px
43+
color: $color_urgent_coral
44+
4145
&.important
42-
border: 1px solid #EBDCEB
43-
background: #FDFAFD
46+
border-top: 1px solid #ece6e7
47+
border-left: 6px solid $color_urgent_coral
48+
border-bottom: 1px solid $color_urgent_coral
49+
border-right: 1px solid #ece6e7
50+
border-radius: 2px
51+
margin-bottom: 30px
52+
padding-left: 20px
53+
padding-right: 8px
54+
background-color: #FDFDFD
55+
color: #383838
56+
align-items: center
57+
58+
&:dir(rtl)
59+
padding-left: 8px
60+
padding-right: 20px
61+
text-align: right
62+
border-top: 1px solid #ece6e7
63+
border-left: 1px solid #ece6e7
64+
border-bottom: 1px solid $color_urgent_coral
65+
border-right: 6px solid $color_urgent_coral
4466

45-
strong
46-
color: #673466
4767
p
4868
color: #555555

securedrop/source_app/main.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,21 @@ def login():
296296

297297
@view.route('/logout')
298298
def logout():
299+
"""
300+
If a user is logged in, show them a logout page that prompts them to
301+
click the New Identity button in Tor Browser to complete their session.
302+
Otherwise redirect to the main Source Interface page.
303+
"""
299304
if logged_in():
300-
msg = render_template('logout_flashed_message.html')
301305

302306
# Clear the session after we render the message so it's localized
303307
# If a user specified a locale, save it and restore it
304308
user_locale = g.locale
305309
session.clear()
306310
session['locale'] = user_locale
307311

308-
flash(Markup(msg), "important hide-if-not-tor-browser")
309-
return redirect(url_for('.index'))
312+
return render_template('logout.html')
313+
else:
314+
return redirect(url_for('.index'))
310315

311316
return view

securedrop/source_templates/flashed.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<img src="{{ url_for('static', filename='i/font-awesome/info-circle-black.png') }}" width="20" height="16">
88
{% elif category == 'error' %}
99
<img class="pull-left" src="{{ url_for('static', filename='i/font-awesome/exclamation-triangle-black.png') }}" width="20" height="17">
10+
{% elif category == 'important' %}
11+
<img src="{{ url_for('static', filename='i/bang-stop.png') }}" width="22" height="22">
1012
{% endif %}
1113
{{ message }}
1214
</div>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% extends "base.html" %}
2+
{% block body %}
3+
<a href="{{ url_for('main.login') }}" class="btn pull-right"> {{ gettext('LOG IN') }}
4+
</a>
5+
<br class="clearfix">
6+
<h1>{{ gettext('One more thing...') }}</h1>
7+
<p id="click-new-identity-tor"> {{ gettext('Click the <img src={icon} alt="broom icon" width="16" height="16">&nbsp;<strong>New Identity</strong> button in your Tor browser\'s toolbar. This will clear your Tor browser activity data on this device.').format(icon=url_for('static', filename='i/torbroom-black.png')) }}</p>
8+
{% endblock %}

securedrop/source_templates/logout_flashed_message.html

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1+
<div class="flash important-header" dir="{{ g.text_direction }}">
2+
<strong>{{ gettext('Important') }}</strong>
3+
</div>
14
<div class="localized" dir="{{ g.text_direction }}">
2-
<div class="icon">
3-
<img src="{{ url_for('static', filename='i/hand_with_fingerprint.png') }}">
4-
</div>
5-
<div class="message"><strong>{{ gettext('Important!') }}</strong><br>
6-
<p>{{ gettext('Your session timed out due to inactivity. Please login again if you want to continue using SecureDrop, or select "New Identity" from the onion button in the Tor browser\'s toolbar to clear all history of your SecureDrop usage from this device. If you are not using Tor Browser, restart your browser.') }}</p>
7-
</div>
5+
<p>{{ gettext('You were logged out due to inactivity. Click the <img src={icon} alt="broom icon" width="16" height="16">&nbsp;<strong>New Identity</strong> button in your Tor browser\'s toolbar before moving on. This will clear your Tor browser activity data on this device.').format(icon=url_for('static', filename='i/torbroom-coral.png')) }}</p>
86
</div>

securedrop/static/i/bang-stop.png

637 Bytes
Loading
1.85 KB
Loading
1.17 KB
Loading

0 commit comments

Comments
 (0)