Skip to content

Commit

Permalink
Enable auth via API Key
Browse files Browse the repository at this point in the history
  • Loading branch information
proffalken committed Oct 22, 2023
1 parent cc744b1 commit 9e20c81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions docs/SPACEDIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ Let's say you're opening the space and you want to ensure that everyone knows it
You can do this with the following command:

```bash
curl -X POST -d 'username=<myuser>&password=<mypass>' \
'https://<your_membermatters_installation/api/token' # Use the output of this command for the next one


curl -X POST -H 'Authorization: Token <response from above>' \
curl -X POST -H 'Authorization: Api-Key <Your API KEY>' \
-d '{"is_open": true, "message": "Open Night TONIGHT! All Welcome between 1800hrs and 2300hrs"}' \
https://<your_membermatters_installation>/api/spacedirectory/update
```
Expand Down
2 changes: 1 addition & 1 deletion memberportal/api_spacedirectory/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def get(self, request):
class SpaceDirectoryUpdate(APIView):
"""Allows authenticated users to update the SpaceAPI information"""

permissions_classes = permissions.IsAuthenticated | HasAPIKey
permission_classes = (permissions.IsAdminUser | HasAPIKey,)

def post(self, request):
# Get the current state of the space
Expand Down

0 comments on commit 9e20c81

Please sign in to comment.