You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-31 09:24:31 +03:00
storage: make the access token expiration optional
This commit is contained in:
@ -13,7 +13,6 @@
|
||||
// limitations under the License.
|
||||
|
||||
use axum::http::Request;
|
||||
use chrono::Duration;
|
||||
use hyper::StatusCode;
|
||||
use mas_data_model::{AccessToken, Client, TokenType, User};
|
||||
use mas_router::SimpleRoute;
|
||||
@ -106,13 +105,7 @@ async fn start_oauth_session(
|
||||
|
||||
let access_token = repo
|
||||
.oauth2_access_token()
|
||||
.add(
|
||||
&mut rng,
|
||||
&state.clock,
|
||||
&session,
|
||||
access_token_str,
|
||||
Duration::minutes(5),
|
||||
)
|
||||
.add(&mut rng, &state.clock, &session, access_token_str, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
@ -115,7 +115,7 @@ pub(crate) async fn generate_token_pair<R: RepositoryAccess>(
|
||||
|
||||
let access_token = repo
|
||||
.oauth2_access_token()
|
||||
.add(rng, clock, session, access_token_str, ttl)
|
||||
.add(rng, clock, session, access_token_str, Some(ttl))
|
||||
.await?;
|
||||
|
||||
let refresh_token = repo
|
||||
|
@ -529,7 +529,7 @@ async fn client_credentials_grant(
|
||||
|
||||
let access_token = repo
|
||||
.oauth2_access_token()
|
||||
.add(rng, clock, &session, access_token_str, ttl)
|
||||
.add(rng, clock, &session, access_token_str, Some(ttl))
|
||||
.await?;
|
||||
|
||||
let mut params = AccessTokenResponse::new(access_token.access_token).with_expires_in(ttl);
|
||||
|
Reference in New Issue
Block a user