Skip to content

Commit

Permalink
Merge pull request #116 from cuebook/CUEAPP#2437
Browse files Browse the repository at this point in the history
Cueapp #2437 Auth Fixes
  • Loading branch information
vincue authored Aug 17, 2021
2 parents 3b3e9f9 + b81134d commit dcc2fd3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion api/users/tests/test_user_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import pytest
from unittest import mock
from django.test import Client

from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.utils.encoding import force_bytes
Expand Down Expand Up @@ -38,4 +39,16 @@ def test_authenticate_post(setup_user, client):
assert response.json()["success"] == True
data = {"email": "random@cuebook.ai", "password": "random"}
response = client.post(path, data=json.dumps(data), content_type="application/json")
assert response.json()["success"] == False
assert response.json()["success"] == False

# @pytest.mark.django_db(transaction=True)
def test_auth_middleware(setup_user, client):
""" test middleware """
c = Client()
res = c.post("/accounts/login", {"email": "admin@domain.com", "password": "admin"} , follow=True)
res.status_code == 200
res = c.get("/accounts/login", follow=True)
assert res.status_code == 200
path = reverse("anomalyDefs")
res = c.get(path)
assert res.status_code == 200
2 changes: 1 addition & 1 deletion ui/src/components/Sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default function Sidebar(props) {
<Button
type="secondary"
onClick={signOut}
className={"uppercase font-bold py-3 text-gray-800 "}
className={"uppercase font-bold text-gray-800 "}
>
<i className={"fas fa-sign-out-alt mr-2 text-sm text-gray-400 "}></i>
SIGN OUT
Expand Down

0 comments on commit dcc2fd3

Please sign in to comment.