Skip to content

Commit

Permalink
Merge pull request #1173 from ScilifelabDataCentre/handle_totp_90sec_web
Browse files Browse the repository at this point in the history
Fix for showing the 90 second TOTP warning
  • Loading branch information
i-oden authored May 13, 2022
2 parents 350791f + d250321 commit ae18b57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@ Please add a _short_ line describing the PR you make, if the PR implements a spe
- Bug: Check for timestamp `0000-00-00 00:00:00` added and invite deleted ([#1163](https://github.com/ScilifelabDataCentre/dds_web/pull/1163))
- Add documentation of status codes in `api/project.py` ([#1164](https://github.com/ScilifelabDataCentre/dds_web/pull/1164))
- Add ability to switch to using TOTP and back to HOTP for MFA ([#936](https://github.com/scilifelabdatacentre/dds_web/issues/936))
- Patch: Fix the warning in web for too soon TOTP login (within 90 seconds) ([#1173](https://github.com/ScilifelabDataCentre/dds_web/pull/1173))
- Bug: Do not remove the bucket when emptying the project ([#1172](https://github.com/ScilifelabDataCentre/dds_web/pull/1172))
- New `add-missing-buckets` argument option to the `lost-files` flask command ([#1174](https://github.com/ScilifelabDataCentre/dds_web/pull/1174))
6 changes: 4 additions & 2 deletions dds_web/web/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,10 @@ def confirm_2fa():
# Raises authenticationerror if invalid
try:
twofactor_verify(twofactor_value.encode())
except ddserr.AuthenticationError:
flask.flash("Invalid one-time code.", "warning")
except ddserr.AuthenticationError as err:
message = str(err)
message = message.removeprefix("401 Unauthorized: ")
flask.flash(message, "warning")
return flask.redirect(
flask.url_for(
"auth_blueprint.confirm_2fa",
Expand Down

0 comments on commit ae18b57

Please sign in to comment.