Skip to content

Commit

Permalink
[chores] Updated sesame authentication failure message
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy authored Feb 7, 2022
1 parent 554086c commit 747fb45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openwisp_users/api/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ def authenticate(self, request):
def authenticate_credentials(self, key):
user = get_user_from_one_time_auth_token(key)
if user is None:
raise exceptions.AuthenticationFailed(_('Invalid token.'))
raise exceptions.AuthenticationFailed(_('Invalid or expired token.'))
return (user, key)
1 change: 1 addition & 0 deletions openwisp_users/tests/test_api/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def my_view(request):
)
response = my_view(request)
self.assertEqual(response.status_code, 403)
self.assertEqual(str(response.data['detail']), 'Invalid or expired token.')

with self.subTest('Test ideal flow'):
request = self.factory.get(
Expand Down

0 comments on commit 747fb45

Please sign in to comment.