all repos

onasty @ 8b28667

a one-time notes service

onasty/api/paths/auth/oauth-provider-callback.yml (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
feat(web): add oauth login (#213)..., 8 months ago
1
get:
2
  tags: [OAuth]
3
  summary: OAuth callback handler
4
  security:
5
    - {}
6
7
  parameters:
8
    - name: provider
9
      in: path
10
      required: true
11
      schema:
12
        type: string
13
        enum: [google, github]
14
15
    - name: code
16
      in: query
17
      required: true
18
      description: Authorization code from OAuth provider
19
      schema:
20
        type: string
21
        example: "4/0AX4XfWjYxT5..."
22
23
    - name: state
24
      in: query
25
      required: false
26
      description: CSRF protection state parameter
27
      schema:
28
        type: string
29
30
  responses:
31
    '302':
32
      description: Redirect to frontend with tokens
33
      headers:
34
        Location:
35
          description: Frontend URL with tokens or error as query params
36
          schema:
37
            type: string
38
            example: "onasty.local/api/v1/auth/callback?access_token=...&refresh_token=...&error=..."
39
40
    '400':
41
      $ref: '../../components/responses/ErrorResponse.yml'
42
43
    '500':
44
      $ref: '../../components/responses/ErrorResponse.yml'