Skip to content

Rough time accessing PrivateCookieJar from new FromRequestParts #1771

Answered by jakswa
jakswa asked this question in Q&A
Discussion options

You must be logged in to vote

Seems I can't mark a threaded reply as my answer, but his example here definitely got me past this (I might've had it in a random iteration previously, but it was hard to tell):

(pasting only the part I stared at and used to verify my code, see thread above for the full thing)

#[tokio::main]
async fn main() {
    let key = Key::generate();

    let app = Router::new().route("/", get(handler)).with_state(key);

    axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
        .serve(app.into_make_service())
        .await
        .unwrap();
}

async fn handler(auth_from_parts: AuthFromParts, auth_from_request: AuthFromRequest) {}

// extractor that implements `FromRequestParts`
// implement…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@jakswa
Comment options

@davidpdrsn
Comment options

@jakswa
Comment options

@davidpdrsn
Comment options

@jakswa
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jakswa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants