ezidam: ability to clone page
This commit is contained in:
parent
b64766cd4b
commit
d2e1792f3c
4 changed files with 7 additions and 5 deletions
|
|
@ -11,6 +11,7 @@ pub mod content {
|
|||
|
||||
#[derive(Serialize)]
|
||||
#[serde(crate = "rocket::serde")]
|
||||
#[derive(Clone)]
|
||||
pub struct Error {
|
||||
pub message: String,
|
||||
pub http_code: u16,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use crate::menu::MenuWithActiveItem;
|
|||
use erased_serde::Serialize;
|
||||
pub use flash::FlashKind;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum Page {
|
||||
Error(Error),
|
||||
Setup,
|
||||
|
|
|
|||
|
|
@ -29,16 +29,15 @@ pub async fn authorize_page(
|
|||
|
||||
transaction.commit().await?;
|
||||
|
||||
// Define content
|
||||
let content = super::content::Authorize {
|
||||
let page = Page::Authorize(super::content::Authorize {
|
||||
app_name: app.label().into(),
|
||||
business_name: settings.business_name().into(),
|
||||
user: user.map(|user| user.0),
|
||||
};
|
||||
});
|
||||
|
||||
Ok(flash
|
||||
.map(|flash| Page::with_flash(Page::Authorize(content.clone()), flash))
|
||||
.unwrap_or_else(|| Page::Authorize(content).into()))
|
||||
.map(|flash| Page::with_flash(page.clone(), flash))
|
||||
.unwrap_or_else(|| page.into()))
|
||||
}
|
||||
|
||||
#[get("/oauth/authorize", rank = 2)]
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ pub mod content {
|
|||
|
||||
#[derive(Serialize)]
|
||||
#[serde(crate = "rocket::serde")]
|
||||
#[derive(Clone)]
|
||||
pub struct Homepage {
|
||||
pub user: JwtClaims,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue