Skip to content

Commit ebea8a8

Browse files
committed
- refactoring: change error message
1 parent 837b93a commit ebea8a8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

api/authentication/serializers/login.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
def _generate_jwt_token(user):
12-
1312
token = jwt.encode({
1413
'id': user.pk,
1514
'exp': datetime.utcnow() + timedelta(days=7)
@@ -41,7 +40,10 @@ def validate(self, data):
4140

4241
if user is None:
4342
raise serializers.ValidationError(
44-
'A user with this email and password was not found.'
43+
{
44+
"success": False,
45+
"msg": "Wrong credentials"
46+
}
4547
)
4648

4749
if not user.is_active:

0 commit comments

Comments
 (0)