Skip to content

Commit 9283aee

Browse files
committed
Schema root_validation refactor
1 parent d6d3c41 commit 9283aee

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

ninja_jwt/schema.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,8 @@ def validate_inputs(cls, values: Dict) -> dict:
4747

4848
if not values.get("password"):
4949
raise exceptions.ValidationError({"password": "password is required"})
50-
return values
51-
52-
@root_validator
53-
def validate_schema(cls, values: Dict) -> dict:
54-
authenticate_kwargs = {
55-
user_name_field: values[user_name_field],
56-
"password": values["password"],
57-
}
5850

59-
cls._user = authenticate(**authenticate_kwargs)
51+
cls._user = authenticate(**values)
6052

6153
if not api_settings.USER_AUTHENTICATION_RULE(cls._user):
6254
raise exceptions.AuthenticationFailed(

0 commit comments

Comments
 (0)