File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,10 @@ pub async fn login(
8181/// Logs the user out of the platform by destroying their session.
8282/// Test this with curl: curl -v \
8383/// --header "Cookie: id=07bbbe54-bd35-425f-8e63-618a8d8612df" \
84- /// --request GET http://localhost:4000/logout
84+ /// --request DELETE http://localhost:4000/user_sessions/:id
8585#[ utoipa:: path(
8686get,
87- path = "/logout " ,
87+ path = "/delete " ,
8888responses(
8989 ( status = 200 , description = "Successfully logged out" ) ,
9090 ( status = 401 , description = "Unauthorized" ) ,
@@ -94,8 +94,8 @@ security(
9494 ( "cookie_auth" = [ ] )
9595)
9696) ]
97- pub async fn logout ( mut auth_session : AuthSession ) -> impl IntoResponse {
98- debug ! ( "UserSessionController::logout ()" ) ;
97+ pub async fn delete ( mut auth_session : AuthSession ) -> impl IntoResponse {
98+ trace ! ( "UserSessionController::delete ()" ) ;
9999 match auth_session. logout ( ) . await {
100100 Ok ( _) => StatusCode :: OK . into_response ( ) ,
101101 Err ( _) => StatusCode :: INTERNAL_SERVER_ERROR . into_response ( ) ,
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ use self::organization::coaching_relationship_controller;
6666 overarching_goal_controller:: update_status,
6767 user_controller:: update,
6868 user_session_controller:: login,
69- user_session_controller:: logout ,
69+ user_session_controller:: delete ,
7070 jwt_controller:: generate_collab_token,
7171 ) ,
7272 components(
@@ -345,7 +345,10 @@ pub fn user_routes(app_state: AppState) -> Router {
345345pub fn user_session_protected_routes ( ) -> Router {
346346 Router :: new ( )
347347 . route ( "/protected" , get ( user_session_controller:: protected) )
348- . route ( "/logout" , delete ( user_session_controller:: logout) )
348+ . route (
349+ "/user_sessions/:id" ,
350+ delete ( user_session_controller:: delete) ,
351+ )
349352 . route_layer ( login_required ! ( Backend , login_url = "/login" ) )
350353}
351354
You can’t perform that action at this time.
0 commit comments