Skip to content

Commit

Permalink
Merge pull request #9 from CKY-/priterprint-api
Browse files Browse the repository at this point in the history
chore: prittyfiy pages
  • Loading branch information
brumoen authored Jan 4, 2025
2 parents 7914aef + 2f153c3 commit 34eb13b
Show file tree
Hide file tree
Showing 14 changed files with 962 additions and 1,042 deletions.
10 changes: 2 additions & 8 deletions src/app/v5/api/auth/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Redirects the user to the authorization URI of the specified authentication prov

```
GET /auth?providerId=google
```

#### Example Response (Redirect):
Expand All @@ -24,7 +23,6 @@ This will redirect the user to the authorization URI of the specified provider (
```http
HTTP/1.1 302 Found
Location: https://accounts.google.com/o/oauth2/auth?client_id=...&redirect_uri=...&response_type=code&scope=...
```

## `GET /auth/callback2`
Expand All @@ -42,7 +40,6 @@ for an access token.

```
GET /auth/callback2?state=google&code=authorizationCodeHere
```

#### Example Response (Redirect):
Expand All @@ -52,7 +49,6 @@ Upon success, redirects to the login success page.
```http
HTTP/1.1 302 Found
Location: /loginsuccess?provider=google
```

#### Example Response (Error):
Expand All @@ -61,16 +57,14 @@ If the `state` parameter is invalid or missing, returns an error response.

```json
{
"error": "Invalid provider id in state"
"error": "Invalid provider id in state"
}

```

If the authentication fails (e.g., invalid token exchange or an OAuth error), the response will be:

```json
{
"error": "Authentication failed"
"error": "Authentication failed"
}

```
Loading

0 comments on commit 34eb13b

Please sign in to comment.