File tree Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -136,9 +136,7 @@ pub(crate) async fn get(
136136
137137 let ( csrf_token, cookie_jar) = cookie_jar. csrf_token ( & clock, & mut rng) ;
138138
139- let session_counts = count_user_sessions_for_limiting ( & mut repo, & session. user )
140- . await
141- . map_err ( |e| RouteError :: Internal ( e. into ( ) ) ) ?;
139+ let session_counts = count_user_sessions_for_limiting ( & mut repo, & session. user ) . await ?;
142140
143141 let res = policy
144142 . evaluate_authorization_grant ( mas_policy:: AuthorizationGrantInput {
@@ -240,9 +238,7 @@ pub(crate) async fn post(
240238 return Err ( RouteError :: GrantNotPending ( grant. id ) ) ;
241239 }
242240
243- let session_counts = count_user_sessions_for_limiting ( & mut repo, & browser_session. user )
244- . await
245- . map_err ( |e| RouteError :: Internal ( e. into ( ) ) ) ?;
241+ let session_counts = count_user_sessions_for_limiting ( & mut repo, & browser_session. user ) . await ?;
246242
247243 let res = policy
248244 . evaluate_authorization_grant ( mas_policy:: AuthorizationGrantInput {
Original file line number Diff line number Diff line change @@ -103,9 +103,7 @@ pub(crate) async fn get(
103103 . context ( "Client not found" )
104104 . map_err ( InternalError :: from_anyhow) ?;
105105
106- let session_counts = count_user_sessions_for_limiting ( & mut repo, & session. user )
107- . await
108- . map_err ( InternalError :: from_anyhow) ?;
106+ let session_counts = count_user_sessions_for_limiting ( & mut repo, & session. user ) . await ?;
109107
110108 // Evaluate the policy
111109 let res = policy
@@ -210,9 +208,7 @@ pub(crate) async fn post(
210208 . context ( "Client not found" )
211209 . map_err ( InternalError :: from_anyhow) ?;
212210
213- let session_counts = count_user_sessions_for_limiting ( & mut repo, & session. user )
214- . await
215- . map_err ( InternalError :: from_anyhow) ?;
211+ let session_counts = count_user_sessions_for_limiting ( & mut repo, & session. user ) . await ?;
216212
217213 // Evaluate the policy
218214 let res = policy
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ pub async fn load_session_or_fallback(
136136pub ( crate ) async fn count_user_sessions_for_limiting (
137137 repo : & mut BoxRepository ,
138138 user : & User ,
139- ) -> anyhow :: Result < SessionCounts > {
139+ ) -> Result < SessionCounts , RepositoryError > {
140140 let oauth2 = repo
141141 . oauth2_session ( )
142142 . count ( OAuth2SessionFilter :: new ( ) . active_only ( ) . for_user ( user) )
You can’t perform that action at this time.
0 commit comments