UMDLARS / dtanm

A framework to teach adversarial thinking to software developers without requiring any special security knowledge
3 stars 2 forks source link

Add Attack and Team 404 Handlers #130

Closed jnowaczek closed 2 years ago

jnowaczek commented 2 years ago

Ref Issue #119

This PR adds HTTP 404 - Not Found error handlers to the Teams and Attacks blueprints. If a user has directly navigated to an attack or team that does not exist, the 'object_not_found.html' template is displayed:

image image

If a request for an invalid attack or team does have a referrer set, the error handler will redirect back to the referring page and display an error toast popup:

image

I chose to implement both behaviors because it seemed frustrating to make users that clicked a broken link in the UI navigate back to where they came from, but users that clicked a link from outside the site that led to a non-existent page would not see a toast error. It would be trivial to adopt one approach over the other, or to introduce other types of error handlers.