Skip to content

Commit

Permalink
docs: add authentication section (open-sauced#62)
Browse files Browse the repository at this point in the history
add authentication section to the docs
  • Loading branch information
diivi authored Mar 14, 2023
1 parent 9f7f22b commit 26f8511
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docs/contributing/set-up-authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
id: set-up-authentication
title: Set up Authentication
sidebar_label: Set up Authentication
keywords:
- set up authentication
---

To interact with the OpenSauced public API as an authenticated user, you need to obtain an authentication token.
The following steps outline how to obtain an authentication token from the [hot.opensauced.pizza](https://hot.opensauced.pizza) website:

1. Click on your avatar in the top right corner of the page. This will open a dropdown menu.

![Avatar in top right corner of the page](../../static/img/contributing-avatar-top-right.png)

2. Click on the **Print Auth Token** option. Don't worry, this is a safe operation. The token is only printed to the console.

![Print Auth Token](../../static/img/contributing-print-auth-token.png)

3. Copy the token that is printed to the console.

![Token printed to the console](../../static/img/contributing-token-printed-to-console.png)

4. You can now use this token to make authenticated requests to the OpenSauced public API by including it in the Authorization header of your requests. For example:

```javascript
const response = await fetch("https://api.opensauced.pizza/v1/auth/session", {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
});
```
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
'contributing/introduction-to-contributing',
'contributing/code-of-conduct',
'contributing/triage-guide',
'contributing/set-up-authentication'
],
},
{
Expand Down
Binary file added static/img/contributing-avatar-top-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/contributing-print-auth-token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 26f8511

Please sign in to comment.