add fallback to url generating 404

This commit is contained in:
Trinity Pointard
2018-06-04 21:57:03 +02:00
parent 2fde47d909
commit 8158f19b85
8 changed files with 53 additions and 11 deletions
+6 -1
View File
@@ -1,7 +1,7 @@
use activitystreams_types::collection::OrderedCollection;
use rocket::{
request::Form,
response::Redirect
response::{Redirect, Flash}
};
use rocket_contrib::Template;
use serde_json;
@@ -53,6 +53,11 @@ fn new(user: User) -> Template {
}))
}
#[get("/blogs/new", rank = 2)]
fn new_auth() -> Flash<Redirect>{
utils::requires_login("You need to be logged in order to create a new blog", "/blogs/new")
}
#[derive(FromForm)]
struct NewBlogForm {
pub title: String