mirror of
https://github.com/Blair-SGA-Dev-Team/blazerapp.git
synced 2024-11-21 20:41:16 -05:00
fix to redirect
This commit is contained in:
parent
60f40bdd55
commit
6013abf15c
|
@ -5,7 +5,7 @@ use oauth2::{
|
|||
};
|
||||
use reqwest::blocking::Client;
|
||||
use rocket::{
|
||||
http::{Cookie, Cookies, SameSite, Status},
|
||||
http::{Cookie, Cookies, Status},
|
||||
request,
|
||||
request::FromRequest,
|
||||
response::Redirect,
|
||||
|
@ -170,7 +170,7 @@ pub fn callback(
|
|||
};
|
||||
if auths.into_iter().any(|x| x == email.as_str().unwrap_or("")) {
|
||||
let mut cook = Cookie::new("token", secret.to_string());
|
||||
cook.set_same_site(SameSite::Strict);
|
||||
// cook.set_same_site(SameSite::Strict);
|
||||
cook.set_http_only(true);
|
||||
cook.set_secure(true);
|
||||
cookies.add(cook);
|
||||
|
|
|
@ -125,14 +125,6 @@ pub mod defs {
|
|||
type Error = ();
|
||||
|
||||
fn from_form_value(value: &'v RawStr) -> Result<Image, ()> {
|
||||
/*
|
||||
println!("{:?}", value);
|
||||
let file = NamedFile::open(value.to_string());
|
||||
println!("{:?}", file);
|
||||
|
||||
Ok(Image(String::from("pepega")))
|
||||
*/
|
||||
|
||||
let value_uri = match value.url_decode() {
|
||||
Ok(n) => n,
|
||||
Err(_) => return Err(()),
|
||||
|
|
|
@ -73,7 +73,7 @@ fn rocket(port: u16, address: String, env: Environment, pg: PgConnection, sa: Se
|
|||
.manage(sa)
|
||||
.mount(
|
||||
"/",
|
||||
routes![home, home_not_logged_in, login, auth::callback, auth::oauth, static_files],
|
||||
routes![home, home_not_logged_in, login, auth::callback, auth::oauth, static_files, auth::logout],
|
||||
)
|
||||
.mount("/api", routes![
|
||||
data::student::api,
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<a href="/logout">Logout</a>
|
||||
<br>
|
||||
<a href="/ui/events">Events</a>
|
||||
<a href="/ui/new">New</a>
|
||||
<a href="/ui/announcements">Announcements</a>
|
||||
|
|
Loading…
Reference in New Issue
Block a user