Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 821 Bytes

README.md

File metadata and controls

30 lines (24 loc) · 821 Bytes

cc-auth

crates.io MIT licensed docs.rs

Simple backend authorization system.

Simple usage example

use bb8_redis::{RedisConnectionManager, bb8::Pool};
use cc_auth::{ApiToken, check_token};
use cc_utils::prelude::MResult;

pub async fn authorized_action(
  cacher: &Pool<RedisConnectionManager>,
  token: ApiToken,
) -> MResult<()> {
  let user_id = check_token(&token, cacher).await?;
  Ok(())
}