Skip to content

Commit a695e85

Browse files
committed
Disable device_token and edge_token on 20.0.0+ just to be safe
1 parent 137c9de commit a695e85

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

docs/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11

22
## Changelog
33

4+
### 4.0.2
5+
* Disable `device_token` and `edge_token` on system version 20.0.0 and later to avoid accidental usage.
6+
7+
*Released on 2025-06-21*
8+
49
### 4.0.1
510
* **Bug fix:** using `device_token` or `edge_token` on system version 20.0.0 and later would send an invalid request to the server. This is now fixed.
611

docs/reference/switch/dauth.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,10 @@ The error can be inspected using the following attributes:
7979
<span class="docs">Requests a challenge from the `dauth` server.</span>
8080

8181
<code>**async def device_token**(client_id: int) -> dict</code><br>
82-
<span class="docs">Requests a device token from the `dauth` server. The challenge is done automatically.<br><br>
83-
<span style="color: red"><b>NOTE:</b></span> On system version 20.0.0 and later, it is recommended to use `preload_device_tokens` instead, which mimics the behavior of a real Switch.</span>
82+
<span class="docs">Requests a device token from the `dauth` server. The challenge is done automatically. This method is available up to system version 19.0.1.<br><br>
8483

8584
<code>**async def edge_token**(client_id: int, vendor_id: str = "akamai") -> dict</code><br>
86-
<span class="docs">Requests an edge token from the `dauth` server. The challenge is done automatically.<br><br>
87-
<span style="color: red"><b>NOTE:</b></span> On system version 20.0.0 and later, it is recommended to use `preload_edge_tokens` instead, which mimics the behavior of a real Switch.</span>
85+
<span class="docs">Requests an edge token from the `dauth` server. The challenge is done automatically. This method is available up to system version 19.0.1.<br><br>
8886

8987
<code>**async def device_tokens**(client_ids: list[int]) -> dict</code><br>
9088
<span class="docs">Requests a multiple device tokens from the `dauth` server. This method is available on system version 20.0.0 and later.</span>

nintendo/switch/dauth.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,10 @@ async def challenge(self):
367367
async def request_token(self, client_id, vendor_id="akamai", *, edge_token):
368368
# This is a generic method to reduce code duplication between device_token and edge_token
369369

370-
# On system version 20.0.0 and later, we use the new version of the API
371-
# Note: in this case, you probably want to use one of the preload functions instead,
372-
# to mimic the behavior of a real Switch.
370+
# Use one of the preload_* functions on system version 20.0.0 and later, to mimic the
371+
# behavior of a real Switch.
373372
if self.system_version >= 2000:
374-
if edge_token:
375-
token_requests = [{"client_id": "%016x" %client_id}]
376-
else:
377-
token_requests = [{"client_id": "%016x" %client_id, "vendor_id": vendor_id}]
378-
return await self.request_tokens(token_requests, edge_tokens=edge_token)
373+
raise ValueError("This method is only available up to system version 19.0.1")
379374

380375
challenge = await self.challenge()
381376
data = base64.b64decode(challenge["data"] + "==", "-_")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setuptools.setup(
88
name = "nintendoclients",
9-
version = "4.0.1",
9+
version = "4.0.2",
1010
description = "Nintendo network library",
1111
long_description = long_description,
1212
author = "Yannik Marchand",

0 commit comments

Comments
 (0)