Axum handlers for OAuth login and callback flows with rate limiting.
// Source: https://github.com/suyoumo/ClawProBench | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
//! OAuth authentication handlers.
//!
//! Public (no auth required) endpoints for initiating and completing
//! OAuth login flows via configured providers (Google, GitHub).
use std::sync::Arc;
use axum::{
Json,
extract::{Path, Query, State},
http::{HeaderValue, StatusCode, header},
response::{IntoResponse, Redirect, Response},
};
use base64::Engine;
use rand::RngExt as _;
use uuid::Uuid;
use crate::channels::web::oauth::state_store::{OAuthStateStore, new_oauth_flow};
use crate::channels::web::platform::state::GatewayState;
use crate::db::{UserIdentityRecord, UserR
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key