Skip to content

Commit 023df87

Browse files
committed
self review
1 parent 91587da commit 023df87

6 files changed

+8
-64
lines changed

docs/src/reference/hooks.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ Mutation functions can be sync or async.
279279

280280
Provides a `#!python NamedTuple` containing `#!python async login` and `#!python async logout` functions.
281281

282-
This hook utilizes the Django's authentication framework in a way that provides **persistent** authentication across WebSocket and HTTP connections.
282+
This hook utilizes the Django's authentication framework in a way that provides **persistent** login.
283283

284284
=== "components.py"
285285

@@ -307,7 +307,7 @@ This hook utilizes the Django's authentication framework in a way that provides
307307

308308
??? question "Why use this instead of `#!python channels.auth.login`?"
309309

310-
The `#!python channels.auth.*` functions cannot trigger re-renders of your ReactPy components. Additionally, it does not provide persistent authentication when used within ReactPy.
310+
The `#!python channels.auth.*` functions cannot trigger re-renders of your ReactPy components. Additionally, they do not provide persistent authentication when used within ReactPy.
311311

312312
Django's authentication design requires cookies to retain login status. ReactPy is rendered via WebSockets, and browsers do not allow active WebSocket connections to modify cookies.
313313

@@ -350,7 +350,7 @@ Shortcut that returns the WebSocket or HTTP connection's `#!python User`.
350350

351351
### Use User Data
352352

353-
Store or retrieve a `#!python dict` containing user data specific to the connection's `#!python User`.
353+
Store or retrieve a `#!python dict` containing arbitrary data specific to the connection's `#!python User`.
354354

355355
This hook is useful for storing user-specific data, such as preferences, settings, or any generic key-value pairs.
356356

src/reactpy_django/auth/components.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ async def synchronize_auth_callback(status_code: int, response: str):
103103
)
104104

105105
# If needed, synchronize authenication sessions by configuring all relevant session cookies.
106-
# This is achieved by commanding the client to perform a HTTP request to our session manager endpoint,
107-
# which will set any required cookies.
106+
# This is achieved by commanding the client to perform a HTTP request to our API endpoint
107+
# that will set any required cookies.
108108
if sync_needed:
109109
return HttpRequest(
110110
{

src/reactpy_django/migrations/0007_authsession.py renamed to src/reactpy_django/migrations/0007_authtoken.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 5.1.4 on 2024-12-23 04:36
1+
# Generated by Django 5.1.4 on 2024-12-29 07:44
22

33
from django.db import migrations, models
44

@@ -11,9 +11,9 @@ class Migration(migrations.Migration):
1111

1212
operations = [
1313
migrations.CreateModel(
14-
name='AuthSession',
14+
name='AuthToken',
1515
fields=[
16-
('uuid', models.UUIDField(editable=False, primary_key=True, serialize=False, unique=True)),
16+
('value', models.UUIDField(editable=False, primary_key=True, serialize=False, unique=True)),
1717
('session_key', models.CharField(editable=False, max_length=40)),
1818
('created_at', models.DateTimeField(auto_now_add=True)),
1919
],

src/reactpy_django/migrations/0008_rename_authsession_switchsession.py

-17
This file was deleted.

src/reactpy_django/migrations/0009_rename_switchsession_synchronizesession.py

-17
This file was deleted.

src/reactpy_django/migrations/0010_rename_synchronizesession_authtoken_and_more.py

-22
This file was deleted.

0 commit comments

Comments
 (0)