ezidam: oauth: redirect page
This commit is contained in:
parent
fd16e78fb1
commit
719048e268
3 changed files with 53 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ pub enum Page {
|
||||||
Setup,
|
Setup,
|
||||||
Homepage(Homepage),
|
Homepage(Homepage),
|
||||||
Authorize(Authorize),
|
Authorize(Authorize),
|
||||||
|
Redirect,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Page {
|
impl Page {
|
||||||
|
|
@ -24,6 +25,7 @@ impl Page {
|
||||||
Page::Setup => "pages/setup",
|
Page::Setup => "pages/setup",
|
||||||
Page::Homepage(_) => "pages/homepage",
|
Page::Homepage(_) => "pages/homepage",
|
||||||
Page::Authorize(_) => "pages/oauth/authorize",
|
Page::Authorize(_) => "pages/oauth/authorize",
|
||||||
|
Page::Redirect => "pages/oauth/redirect",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,6 +36,7 @@ impl Page {
|
||||||
Page::Setup => "Setup",
|
Page::Setup => "Setup",
|
||||||
Page::Homepage(_) => "Home",
|
Page::Homepage(_) => "Home",
|
||||||
Page::Authorize(_) => "Authorize app",
|
Page::Authorize(_) => "Authorize app",
|
||||||
|
Page::Redirect => "Redirecting",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,6 +47,7 @@ impl Page {
|
||||||
Page::Setup => None,
|
Page::Setup => None,
|
||||||
Page::Homepage(_) => Some(Item::Home.into()),
|
Page::Homepage(_) => Some(Item::Home.into()),
|
||||||
Page::Authorize(_) => None,
|
Page::Authorize(_) => None,
|
||||||
|
Page::Redirect => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -54,6 +58,7 @@ impl Page {
|
||||||
Page::Setup => Box::new(()),
|
Page::Setup => Box::new(()),
|
||||||
Page::Homepage(homepage) => Box::new(homepage),
|
Page::Homepage(homepage) => Box::new(homepage),
|
||||||
Page::Authorize(authorize) => Box::new(authorize),
|
Page::Authorize(authorize) => Box::new(authorize),
|
||||||
|
Page::Redirect => Box::new(()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
9
crates/ezidam/src/routes/oauth/redirect.rs
Normal file
9
crates/ezidam/src/routes/oauth/redirect.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
use crate::routes::prelude::*;
|
||||||
|
use rocket::get;
|
||||||
|
|
||||||
|
#[get("/oauth/redirect")]
|
||||||
|
pub async fn redirect_page(mut db: Connection<Database>) -> Result<Page> {
|
||||||
|
// TODO: make request to oauth token
|
||||||
|
|
||||||
|
Ok(Page::Redirect)
|
||||||
|
}
|
||||||
39
crates/ezidam/templates/pages/oauth/redirect.html.tera
Normal file
39
crates/ezidam/templates/pages/oauth/redirect.html.tera
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
{% extends "base" %}
|
||||||
|
|
||||||
|
{% block page %}
|
||||||
|
<body class=" d-flex flex-column">
|
||||||
|
<script src="/js/demo-theme.min.js"></script>
|
||||||
|
<div>
|
||||||
|
<div class="min-vh-100 d-flex flex-column justify-content-between">
|
||||||
|
<div class="page page-center">
|
||||||
|
<div class="container container-tight py-4">
|
||||||
|
<div class="text-center mb-4">
|
||||||
|
{% include "utils/logo" %}
|
||||||
|
</div>
|
||||||
|
<div class="card card-md">
|
||||||
|
<div class="card-body text-center">
|
||||||
|
<div class="mb-4">
|
||||||
|
<h2 class="card-title">Hello!</h2>
|
||||||
|
<p class="text-muted">Preparing application</p>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4">
|
||||||
|
<span class="avatar avatar-xl mb-3"
|
||||||
|
style="background-image: url(/avatar/6NcYrAM3J9EKLiE?size=250)"></span>
|
||||||
|
<h3>Fullname or username</h3>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4 container-slim progress progress-sm">
|
||||||
|
<div class="progress-bar progress-bar-indeterminate"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% include "shell/footer" %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Libs JS -->
|
||||||
|
<!-- Tabler Core -->
|
||||||
|
<script src="/js/tabler.min.js" defer></script>
|
||||||
|
<script src="/js/demo.min.js" defer></script>
|
||||||
|
</body>
|
||||||
|
{% endblock page %}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue