square-authentication 5.1.3__py3-none-any.whl → 5.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,7 +75,7 @@ async def register_username_v0(
75
75
  validation
76
76
  """
77
77
  # validation for username
78
- local_list_response_user_profile = (
78
+ local_list_response_user_creds = (
79
79
  global_object_square_database_helper.get_rows_v0(
80
80
  database_name=global_string_database_name,
81
81
  schema_name=global_string_schema_name,
@@ -89,20 +89,6 @@ async def register_username_v0(
89
89
  ),
90
90
  )["data"]["main"]
91
91
  )
92
- local_list_response_user_creds = (
93
- global_object_square_database_helper.get_rows_v0(
94
- database_name=global_string_database_name,
95
- schema_name=global_string_schema_name,
96
- table_name=UserCredential.__tablename__,
97
- filters=FiltersV0(
98
- root={
99
- UserCredential.user_id.name: FilterConditionsV0(
100
- eq=local_list_response_user_profile[0][UserProfile.user_id.name]
101
- )
102
- }
103
- ),
104
- )["data"]["main"]
105
- )
106
92
  if len(local_list_response_user_creds) > 0:
107
93
  output_content = get_api_output_in_standard_format(
108
94
  message=messages["USERNAME_ALREADY_EXISTS"],
@@ -561,7 +547,7 @@ async def login_username_v0(body: LoginUsernameV0):
561
547
  validation
562
548
  """
563
549
  # validation for username
564
- local_list_authentication_user_response = (
550
+ local_list_response_user_profile = (
565
551
  global_object_square_database_helper.get_rows_v0(
566
552
  database_name=global_string_database_name,
567
553
  schema_name=global_string_schema_name,
@@ -575,6 +561,29 @@ async def login_username_v0(body: LoginUsernameV0):
575
561
  ),
576
562
  )["data"]["main"]
577
563
  )
564
+ if len(local_list_response_user_profile) != 1:
565
+ output_content = get_api_output_in_standard_format(
566
+ message=messages["INCORRECT_USERNAME"],
567
+ log=f"incorrect username {username}",
568
+ )
569
+ raise HTTPException(
570
+ status_code=status.HTTP_400_BAD_REQUEST,
571
+ detail=output_content,
572
+ )
573
+ local_list_authentication_user_response = (
574
+ global_object_square_database_helper.get_rows_v0(
575
+ database_name=global_string_database_name,
576
+ schema_name=global_string_schema_name,
577
+ table_name=UserCredential.__tablename__,
578
+ filters=FiltersV0(
579
+ root={
580
+ UserCredential.user_id.name: FilterConditionsV0(
581
+ eq=local_list_response_user_profile[0][UserProfile.user_id.name]
582
+ )
583
+ }
584
+ ),
585
+ )["data"]["main"]
586
+ )
578
587
  if len(local_list_authentication_user_response) != 1:
579
588
  output_content = get_api_output_in_standard_format(
580
589
  message=messages["INCORRECT_USERNAME"],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: square-authentication
3
- Version: 5.1.3
3
+ Version: 5.1.4
4
4
  Summary: authentication layer for my personal server.
5
5
  Home-page: https://github.com/thepmsquare/square_authentication
6
6
  Author: thePmSquare
@@ -45,6 +45,10 @@ pip install square_authentication
45
45
 
46
46
  ## changelog
47
47
 
48
+ ### v5.1.4
49
+
50
+ - re bug fix v5.1.3
51
+
48
52
  ### v5.1.3
49
53
 
50
54
  - bugfix in login_username/v0 (getting creds from correct table).
@@ -6,12 +6,12 @@ square_authentication/data/config.ini,sha256=_740RvKpL5W2bUDGwZ7ePwuP-mAasr5cXXB
6
6
  square_authentication/pydantic_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  square_authentication/pydantic_models/core.py,sha256=qeNETcJv7mnRKGhATOW2bg0NlHuyzvot1dZ1b1qqhwU,610
8
8
  square_authentication/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- square_authentication/routes/core.py,sha256=AM_OiqSndZ6-4c28QnEICXx6WZOms9UzHUYk3wBv5ZA,56795
9
+ square_authentication/routes/core.py,sha256=JEKHwCny862J7q5_Rnlxv4gwmXXfNSmLrmI5Tja8mhg,57181
10
10
  square_authentication/routes/utility.py,sha256=ocLWj39JbKVOxgyTsM0xBUgTpHFmKIvvaT3UnjFvuOY,1783
11
11
  square_authentication/utils/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
12
12
  square_authentication/utils/encryption.py,sha256=amlTNbGvq59eFLX6pq084UDLI3deM-urLjb4fOYIeNw,2023
13
13
  square_authentication/utils/token.py,sha256=2psHT6CGqQLmkhsPHVYS8_2jEjN96J9gLAM4lB_fa88,678
14
- square_authentication-5.1.3.dist-info/METADATA,sha256=9W4cTp_4-DIGzWMg4j0601MaeYHCw97gsURKgHG5U0I,4044
15
- square_authentication-5.1.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
16
- square_authentication-5.1.3.dist-info/top_level.txt,sha256=wDssVJIl9KIEJPj5rR3rv4uRI7yCndMBrvHd_6BGXQA,22
17
- square_authentication-5.1.3.dist-info/RECORD,,
14
+ square_authentication-5.1.4.dist-info/METADATA,sha256=lQF_5cNEG-8a6djP85X3f1YFpfo86-ofy2-zY-GjEcI,4077
15
+ square_authentication-5.1.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
16
+ square_authentication-5.1.4.dist-info/top_level.txt,sha256=wDssVJIl9KIEJPj5rR3rv4uRI7yCndMBrvHd_6BGXQA,22
17
+ square_authentication-5.1.4.dist-info/RECORD,,