@@ -10,7 +10,7 @@ use crate::models::{NewUser, User};
1010use crate :: schema:: users;
1111use crate :: util:: errors:: { AppError , ReadOnlyMode } ;
1212
13- /// Handles the `GET /authorize_url ` route.
13+ /// Handles the `GET /api/private/session/begin ` route.
1414///
1515/// This route will return an authorization URL for the GitHub OAuth flow including the crates.io
1616/// `client_id` and a randomly generated `state` secret.
@@ -25,7 +25,7 @@ use crate::util::errors::{AppError, ReadOnlyMode};
2525/// "url": "https://github.com/login/oauth/authorize?client_id=...&state=...&scope=read%3Aorg"
2626/// }
2727/// ```
28- pub fn github_authorize ( req : & mut dyn Request ) -> AppResult < Response > {
28+ pub fn begin ( req : & mut dyn Request ) -> AppResult < Response > {
2929 let ( url, state) = req
3030 . app ( )
3131 . github
@@ -45,7 +45,7 @@ pub fn github_authorize(req: &mut dyn Request) -> AppResult<Response> {
4545 } ) )
4646}
4747
48- /// Handles the `GET /authorize` route.
48+ /// Handles the `GET /api/private/session/ authorize` route.
4949///
5050/// This route is called from the GitHub API OAuth flow after the user accepted or rejected
5151/// the data access permissions. It will check the `state` parameter and then call the GitHub API
@@ -73,7 +73,7 @@ pub fn github_authorize(req: &mut dyn Request) -> AppResult<Response> {
7373/// }
7474/// }
7575/// ```
76- pub fn github_access_token ( req : & mut dyn Request ) -> AppResult < Response > {
76+ pub fn authorize ( req : & mut dyn Request ) -> AppResult < Response > {
7777 // Parse the url query
7878 let mut query = req. query ( ) ;
7979 let code = query. remove ( "code" ) . unwrap_or_default ( ) ;
@@ -144,7 +144,7 @@ impl GithubUser {
144144 }
145145}
146146
147- /// Handles the `GET /logout ` route.
147+ /// Handles the `DELETE /api/private/session ` route.
148148pub fn logout ( req : & mut dyn Request ) -> AppResult < Response > {
149149 req. session ( ) . remove ( & "user_id" . to_string ( ) ) ;
150150 Ok ( req. json ( & true ) )
0 commit comments