prisma_auth 0.1.0

A simple authentication crate supporting both Rocket backend API and Yew frontend authentication components
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// src/types.rs
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct LoginRequest {
    pub password: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct TokenResponse {
    pub token: String,
}

pub const TOKEN_KEY: &str = "auth_token";
pub const DEFAULT_TOKEN_TTL_SECONDS: u64 = 600;