sanic-security 1.17.0__py3-none-any.whl → 1.17.1__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.
@@ -185,7 +185,7 @@ async def fulfill_second_factor(request: Request) -> AuthenticationSession:
185
185
  authentication_session = await AuthenticationSession.decode(request)
186
186
  if not authentication_session.requires_second_factor:
187
187
  raise DeactivatedError("Session second factor requirement already met.", 403)
188
- two_step_session = await TwoStepSession.decode(request)
188
+ two_step_session = await TwoStepSession.decode(request, tag="2fa")
189
189
  two_step_session.validate()
190
190
  await two_step_session.check_code(request.form.get("code"))
191
191
  authentication_session.requires_second_factor = False
@@ -101,7 +101,7 @@ async def on_login(request):
101
101
  )
102
102
  if str_to_bool(request.args.get("two-factor-authentication")):
103
103
  two_step_session = await request_two_step_verification(
104
- request, authentication_session.bearer
104
+ request, authentication_session.bearer, "2fa"
105
105
  )
106
106
  response = json(
107
107
  "Login successful! Two-factor authentication required.",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sanic-security
3
- Version: 1.17.0
3
+ Version: 1.17.1
4
4
  Summary: An async security library for the Sanic framework.
5
5
  Author-email: Aidan Stewart <me@na-stewart.com>
6
6
  Project-URL: Documentation, https://security.na-stewart.com/
@@ -268,7 +268,7 @@ Phone can be null or empty.
268
268
  @app.post("api/security/register")
269
269
  async def on_register(request):
270
270
  account = await register(request)
271
- two_step_session = await request_two_step_verification(request, account, "2fa")
271
+ two_step_session = await request_two_step_verification(request, account)
272
272
  await email_code(
273
273
  account.email, two_step_session.code # Code = 24KF19
274
274
  ) # Custom method for emailing verification code.
@@ -309,7 +309,7 @@ You can use a username as well as an email for login if `ALLOW_LOGIN_WITH_USERNA
309
309
  async def on_login(request):
310
310
  authentication_session = await login(request, require_second_factor=True)
311
311
  two_step_session = await request_two_step_verification(
312
- request, authentication_session.bearer
312
+ request, authentication_session.bearer, "2fa"
313
313
  )
314
314
  await email_code(
315
315
  authentication_session.bearer.email, two_step_session.code # Code = XGED2U
@@ -1,5 +1,5 @@
1
1
  sanic_security/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- sanic_security/authentication.py,sha256=V5CUasXFmA-B7OfMcnqo5BOg7UJjY22mkPQPWTRdQTg,13517
2
+ sanic_security/authentication.py,sha256=kRcxddITe7FrfXCV_71DRGq8U39wJNmXwG1bfnuw-p0,13528
3
3
  sanic_security/authorization.py,sha256=JY3vIG_zlTNaTZ9xyExTADhlLLnfzYZ5FLOePovhzVA,7992
4
4
  sanic_security/configuration.py,sha256=2_XdxFcmMq4UNl1NUon1zBIKMfYCeMN3ixBZTgrNQRM,6039
5
5
  sanic_security/exceptions.py,sha256=CiH4M2bXZpGyh--eGG0TQdZjOu_mjKQiqnalpCLHLGM,4791
@@ -8,10 +8,10 @@ sanic_security/oauth.py,sha256=1aYPr5QGFv-mQYhSoExP7eszn7us0AOy2QJZiQPkptU,8403
8
8
  sanic_security/utils.py,sha256=B-nSBwP2sClkXfJHs5g7t9jmMHnl4LXJPUAeraDBQ7Y,3641
9
9
  sanic_security/verification.py,sha256=qQGc-vn22NM3JkYVERl-1SvG4tv1XN8agTWvuKPKNBE,8193
10
10
  sanic_security/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- sanic_security/test/server.py,sha256=wjYXtd7jMtw28vv3LWpXkl9IQTE7-f6JQi7Q3b7evbA,13356
11
+ sanic_security/test/server.py,sha256=cmRHXyONBY5RZkIgfz6__dMKTr-LGZBFThz0Tp0272o,13363
12
12
  sanic_security/test/tests.py,sha256=AbFCyK7Fg8FjI_Iisi4vAr-ebWsPdKWauZQuyBkAMEo,22071
13
- sanic_security-1.17.0.dist-info/licenses/LICENSE,sha256=DlJ21DRx8S4vaYJPBIDT3Rik4FaxXVYNottjE7oBZio,1079
14
- sanic_security-1.17.0.dist-info/METADATA,sha256=02RUNU1yvW056pDZFERuGvaghwg-j9ecXpAzLr8mjGA,24753
15
- sanic_security-1.17.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- sanic_security-1.17.0.dist-info/top_level.txt,sha256=ZybkhHXSjfzhmv8XeqLvnNmLmv21Z0oPX6Ep4DJN8b0,15
17
- sanic_security-1.17.0.dist-info/RECORD,,
13
+ sanic_security-1.17.1.dist-info/licenses/LICENSE,sha256=DlJ21DRx8S4vaYJPBIDT3Rik4FaxXVYNottjE7oBZio,1079
14
+ sanic_security-1.17.1.dist-info/METADATA,sha256=Jibu09vjT3-TMrViVC2-GddmhRwb4GE8lFZ0usCRmK0,24753
15
+ sanic_security-1.17.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ sanic_security-1.17.1.dist-info/top_level.txt,sha256=ZybkhHXSjfzhmv8XeqLvnNmLmv21Z0oPX6Ep4DJN8b0,15
17
+ sanic_security-1.17.1.dist-info/RECORD,,