logo: full color with a white overlay
This commit is contained in:
parent
a47e4c204a
commit
19840b31e6
2 changed files with 11 additions and 17 deletions
|
|
@ -1,19 +1,19 @@
|
||||||
use crate::routes::prelude::*;
|
use crate::routes::prelude::*;
|
||||||
use crate::tokens::{generate_jwt, generate_refresh_token};
|
use crate::tokens::{generate_jwt, generate_refresh_token};
|
||||||
|
use crate::tokens::{
|
||||||
|
JWT_COOKIE_NAME, JWT_DURATION_MINUTES, REFRESH_TOKEN_COOKIE_NAME, REFRESH_TOKEN_DURATION_DAYS,
|
||||||
|
};
|
||||||
use apps::App;
|
use apps::App;
|
||||||
use authorization_codes::AuthorizationCode;
|
use authorization_codes::AuthorizationCode;
|
||||||
use jwt::database::Key;
|
use jwt::database::Key;
|
||||||
use jwt::PrivateKey;
|
use jwt::PrivateKey;
|
||||||
use refresh_tokens::RefreshToken;
|
use refresh_tokens::RefreshToken;
|
||||||
use rocket::get;
|
use rocket::get;
|
||||||
|
use rocket::http::{Cookie, CookieJar, SameSite};
|
||||||
|
use rocket::time::Duration;
|
||||||
use settings::Settings;
|
use settings::Settings;
|
||||||
use std::net::IpAddr;
|
use std::net::IpAddr;
|
||||||
use users::User;
|
use users::User;
|
||||||
use crate::tokens::{
|
|
||||||
JWT_COOKIE_NAME, JWT_DURATION_MINUTES, REFRESH_TOKEN_COOKIE_NAME, REFRESH_TOKEN_DURATION_DAYS,
|
|
||||||
};
|
|
||||||
use rocket::http::{Cookie, CookieJar, SameSite};
|
|
||||||
use rocket::time::Duration;
|
|
||||||
|
|
||||||
#[get("/oauth/redirect?<redirect_request..>")]
|
#[get("/oauth/redirect?<redirect_request..>")]
|
||||||
pub async fn redirect_page(
|
pub async fn redirect_page(
|
||||||
|
|
@ -74,17 +74,11 @@ pub async fn redirect_page(
|
||||||
.ok_or_else(|| Error::bad_request("Server url is not set"))?;
|
.ok_or_else(|| Error::bad_request("Server url is not set"))?;
|
||||||
|
|
||||||
if jwt_user.is_none() {
|
if jwt_user.is_none() {
|
||||||
// TODO: refactor for "code" route
|
|
||||||
|
|
||||||
// Generate refresh token
|
// Generate refresh token
|
||||||
let refresh_token = generate_refresh_token(
|
let refresh_token =
|
||||||
&mut transaction,
|
generate_refresh_token(&mut transaction, ip_address, user.id(), app.id())
|
||||||
ip_address,
|
.await
|
||||||
user.id(),
|
.map_err(Error::internal_server_error)?;
|
||||||
app.id(),
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.map_err(Error::internal_server_error)?;
|
|
||||||
|
|
||||||
// Add refresh token as a cookie
|
// Add refresh token as a cookie
|
||||||
let mut cookie = Cookie::new(REFRESH_TOKEN_COOKIE_NAME, refresh_token);
|
let mut cookie = Cookie::new(REFRESH_TOKEN_COOKIE_NAME, refresh_token);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<a href="/" class="navbar-brand navbar-brand-autodark">
|
<a href="/" class="navbar-brand bg-white-overlay rounded-3">
|
||||||
<img src="/logo" alt="business logo" style="max-width: 13rem; padding: 1rem;">
|
<img src="/logo" alt="business logo" style="max-width: 13rem; padding: 1rem;">
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue