auth-session

Implement cookie-based authentication and session management for Leptos+Axum apps.

Updated May 26, 2026
One-click install
npx skills add https://github.com/adelabdelgawad/rust-fullstack-agents --skill auth-session
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-session
Source: https://github.com/adelabdelgawad/rust-fullstack-agents/tree/main/plugins/rusty/skills/auth-session
Command: npx skills add https://github.com/adelabdelgawad/rust-fullstack-agents --skill auth-session

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implementing secure, scalable cookie-based authentication and per-request session management for Leptos+Axum apps, ensuring user state is consistently validated across requests.

Core Features & Use Cases

  • Integrates tower-sessions and axum-login to handle login/logout, session storage, and protected routes.
  • Supports per-page auth context in Leptos components and server-side authentication flow for server functions.
  • Use case: build an admin dashboard with a login page, protected routes, and user session context.

Quick Start

Wire up AuthManagerLayer with a backend and a session store to enable login, logout, and protected routes in your Leptos+Axum app.

Frequently Asked Questions about auth-session

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement secure session-based authentication in a Leptos and Axum application?

You can implement cookie-based authentication by wiring up AuthManagerLayer with a backend and a PostgresStore session store, enabling login, logout, and protected routes in your Leptos+Axum application.

Does axum-login work with Leptos server functions for user login and logout?

Yes, axum-login integrates with Leptos server functions to handle user login and logout operations, requiring an AuthUser domain type and AuthnBackend implementation to validate user state across requests.

What is the best way to manage per-page auth context in Leptos components?

Per-page auth context in Leptos components is managed by integrating tower-sessions and axum-login, ensuring server-side authentication flow validates user state consistently across requests for protected routes.

How do I set up a PostgresStore for tower-sessions in an Axum router?

Setting up a PostgresStore for tower-sessions involves configuring the Axum router with the session store and AuthManagerLayer, establishing the database-backed session storage required for secure cookie-based authentication.

Do I need to implement AuthnBackend to use axum-login with Leptos?

Yes, implementing AuthnBackend and defining an AuthUser domain type are required to use axum-login, providing the necessary authentication logic for session management and user validation across server boundaries.

Can I build protected routes with tower-sessions in a Leptos+Axum admin dashboard?

Yes, you can build an admin dashboard with protected routes using tower-sessions and axum-login, providing a login page, user session context, and per-request session validation within your Leptos+Axum application.