fix: got release builds actually working
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
use leptos::prelude::ServerFnError;
|
||||
use leptos::{prelude::expect_context, server_fn::error::NoCustomError};
|
||||
use leptos::{prelude::*, server_fn::error::NoCustomError};
|
||||
use leptos_axum::{extract, ResponseOptions};
|
||||
use pbkdf2::{
|
||||
password_hash::{
|
||||
@@ -121,7 +120,7 @@ pub async fn create_auth_session(username: String, password: String) -> Result<(
|
||||
use axum::http::{header, HeaderValue};
|
||||
use axum_extra::extract::cookie::{Cookie, SameSite};
|
||||
|
||||
let db = expect_context::<SqlitePool>();
|
||||
let db = crate::db::get_db()?;
|
||||
let resp = expect_context::<ResponseOptions>();
|
||||
|
||||
let user: Option<User> =
|
||||
@@ -181,7 +180,7 @@ pub async fn create_auth_session(username: String, password: String) -> Result<(
|
||||
pub async fn destroy_auth_session() -> Result<(), ServerFnError> {
|
||||
use axum_extra::extract::cookie::CookieJar;
|
||||
|
||||
let db = expect_context::<SqlitePool>();
|
||||
let db = crate::db::get_db()?;
|
||||
let jar = extract::<CookieJar>().await?;
|
||||
|
||||
let Some(cookie) = jar.get(SESSION_ID_KEY) else {
|
||||
@@ -200,7 +199,10 @@ pub async fn destroy_auth_session() -> Result<(), ServerFnError> {
|
||||
pub async fn get_auth_session() -> Result<Option<User>, ServerFnError> {
|
||||
use axum_extra::extract::cookie::CookieJar;
|
||||
|
||||
let db = expect_context::<SqlitePool>();
|
||||
println!("In get auth session");
|
||||
let owner = leptos::prelude::Owner::current().unwrap();
|
||||
|
||||
let db = crate::db::get_db()?;
|
||||
let jar = extract::<CookieJar>().await?;
|
||||
|
||||
let Some(cookie) = jar.get(SESSION_ID_KEY) else {
|
||||
|
||||
Reference in New Issue
Block a user