File tree 1 file changed +25
-0
lines changed 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,31 @@ pub fn github_authorize(req: &mut Request) -> CargoResult<Response> {
150
150
}
151
151
152
152
/// Handles the `GET /authorize` route.
153
+ ///
154
+ /// This route is called from the GitHub API OAuth flow after the user accepted or rejected
155
+ /// the data access permissions. It will check the `state` parameter and then call the GitHub API
156
+ /// to exchange the temporary `code` for an API token. The API token is returned together with
157
+ /// the corresponding user information.
158
+ ///
159
+ /// ## Query Parameters
160
+ ///
161
+ /// - `code` – temporary code received from the GitHub API **(Required)**
162
+ /// - `state` – state parameter received from the GitHub API **(Required)**
163
+ ///
164
+ /// ## Response Body Example
165
+ ///
166
+ /// ```json
167
+ /// {
168
+ /// "api_token": "b84a63c4ea3fcb4ac84",
169
+ /// "user": {
170
+
171
+ /// "name": "Foo Bar",
172
+ /// "login": "foobar",
173
+ /// "avatar": "https://avatars.githubusercontent.com/u/1234",
174
+ /// "url": null
175
+ /// }
176
+ /// }
177
+ /// ```
153
178
pub fn github_access_token ( req : & mut Request ) -> CargoResult < Response > {
154
179
// Parse the url query
155
180
let mut query = req. query ( ) ;
You can’t perform that action at this time.
0 commit comments