MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / store_nonce

Function store_nonce

chirpstack/src/api/oidc.rs:131–143  ·  view source on GitHub ↗
(state: &CsrfToken, nonce: &Nonce)

Source from the content-addressed store, hash-verified

129}
130
131async fn store_nonce(state: &CsrfToken, nonce: &Nonce) -> Result<()> {
132 trace!("Storing nonce");
133 let key = redis_key(format!("auth:oidc:{}", state.secret()));
134
135 () = redis::cmd("PSETEX")
136 .arg(key)
137 .arg(Duration::try_minutes(5).unwrap().num_milliseconds())
138 .arg(nonce.secret())
139 .query_async(&mut get_async_redis_conn().await?)
140 .await?;
141
142 Ok(())
143}
144
145async fn get_nonce(state: &CsrfToken) -> Result<Nonce> {
146 trace!("Getting nonce");

Callers 1

login_handlerFunction · 0.85

Calls 3

redis_keyFunction · 0.85
get_async_redis_connFunction · 0.85
unwrapMethod · 0.80

Tested by

no test coverage detected