oauth 0.0.2

Universal OAuth 2.0 adapter for Rust web frameworks
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::config::OAuthConfig;
use crate::error::{OAuthError, Result};

use super::{TokenRequest, TokenResponse};

/// Handle the authorization code grant flow.
///
/// The current implementation is a placeholder to be expanded with real
/// authorization code verification, PKCE validation, and token issuance.
pub fn issue_token(_config: &OAuthConfig, request: &TokenRequest) -> Result<TokenResponse> {
    if request.code.is_none() {
        return Err(OAuthError::InvalidGrant(
            "authorization_code grant requires `code`".into(),
        ));
    }

    Err(OAuthError::NotImplemented("authorization_code grant flow"))
}