Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cueapp #2437 Auth Fixes #116

Merged
merged 4 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 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,13 @@ 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.fixture()
def test_auth_middleware(client, mocker):
""" 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add one more api other than login, from /anomaly or somewhere

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