Changes to support axum 0.8 (#3820)
* changes to support axum 0.8 * fixing ci/cd failures. I would like advice on the change to cli/server * putting back in something I took out because I am retarded * update server function revision * remove playwright test results * clippy --------- Co-authored-by: Evan Almloff <evanalmloff@gmail.com> Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
14 files changed
+297
-315
No files matched your search
@@ -16,7 +16,7 @@ axum = { workspace = true, optional = true }
|
||||
tokio = { workspace = true, features = ["full"], optional = true }
|
||||
tower-http = { workspace = true, features = ["auth"], optional = true }
|
||||
async-trait = { version = "0.1.71", optional = true }
|
||||
sqlx = { version = "0.7.0", features = [
|
||||
sqlx = { version = "0.8.2", features = [
|
||||
"macros",
|
||||
"migrate",
|
||||
"postgres",
|
||||
@@ -34,12 +34,15 @@ anyhow = { workspace = true }
|
||||
|
||||
[dependencies.axum_session]
|
||||
workspace = true
|
||||
features = ["sqlite-rustls"]
|
||||
optional = true
|
||||
|
||||
[dependencies.axum_session_auth]
|
||||
workspace = true
|
||||
features = ["sqlite-rustls"]
|
||||
optional = true
|
||||
|
||||
[dependencies.axum_session_sqlx]
|
||||
workspace = true
|
||||
features = ["sqlite"]
|
||||
optional = true
|
||||
|
||||
[features]
|
||||
@@ -54,6 +57,7 @@ server = [
|
||||
"sqlx",
|
||||
"axum_session",
|
||||
"axum_session_auth",
|
||||
"axum_session_sqlx",
|
||||
"http",
|
||||
"tower",
|
||||
]
|
||||
|
||||
@@ -5,8 +5,9 @@ use axum::{
|
||||
routing::get,
|
||||
Router,
|
||||
};
|
||||
use axum_session::{SessionConfig, SessionLayer, SessionSqlitePool, SessionStore};
|
||||
use axum_session::{SessionConfig, SessionLayer, SessionStore};
|
||||
use axum_session_auth::*;
|
||||
use axum_session_sqlx::SessionSqlitePool;
|
||||
use core::pin::Pin;
|
||||
use dioxus_fullstack::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -192,12 +193,8 @@ pub async fn connect_to_database() -> SqlitePool {
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub type Session = axum_session_auth::AuthSession<
|
||||
crate::auth::User,
|
||||
i64,
|
||||
axum_session_auth::SessionSqlitePool,
|
||||
sqlx::SqlitePool,
|
||||
>;
|
||||
pub type Session =
|
||||
axum_session_auth::AuthSession<crate::auth::User, i64, SessionSqlitePool, sqlx::SqlitePool>;
|
||||
|
||||
pub async fn get_session() -> Result<Session, ServerFnError> {
|
||||
extract::<Session, _>()
|
||||
|
||||
@@ -22,7 +22,7 @@ fn main() {
|
||||
use axum_session::SessionConfig;
|
||||
use axum_session::SessionStore;
|
||||
use axum_session_auth::AuthConfig;
|
||||
use axum_session_auth::SessionSqlitePool;
|
||||
use axum_session_sqlx::SessionSqlitePool;
|
||||
tokio::runtime::Runtime::new()
|
||||
.unwrap()
|
||||
.block_on(async move {
|
||||
@@ -49,7 +49,7 @@ fn main() {
|
||||
axum_session_auth::AuthSessionLayer::<
|
||||
crate::auth::User,
|
||||
i64,
|
||||
axum_session_auth::SessionSqlitePool,
|
||||
SessionSqlitePool,
|
||||
sqlx::SqlitePool,
|
||||
>::new(Some(pool))
|
||||
.with_config(auth_config),
|
||||
|
||||
Reference in new issue
Block a user