@@ -95,10 +95,10 @@ If you have `Public Client` enabled on your Discord app, you can use the followi
95
95
void AuthenticateUser (std::shared_ptr<discordpp::Client> client) {
96
96
// Get your external auth token (Steam, OIDC, etc.)
97
97
std ::string externalToken = GetExternalAuthToken ();
98
-
98
+
99
99
// Get provisional token from Discord
100
- client - > GetProvisionalToken (DISCORD_APPLICATION_ID ,
101
- discordpp ::AuthenticationExternalAuthType ::OIDC ,
100
+ client - > GetProvisionalToken (DISCORD_APPLICATION_ID ,
101
+ discordpp ::AuthenticationExternalAuthType ::OIDC ,
102
102
externalToken ,
103
103
[client ](discordpp ::ClientResult result , std ::string accessToken , std ::string refreshToken , discordpp ::AuthorizationTokenType tokenType , int32_t expiresIn , std ::string scope ) {
104
104
if (result.Successful()) {
@@ -222,7 +222,7 @@ client->UpdateProvisionalAccountDisplayName("CoolPlayer123", [](discordpp::Clien
222
222
223
223
## Merging Provisional Accounts
224
224
225
- When a player wants to convert their provisional acount to a full Discord account.
225
+ When a player wants to convert their provisional account to a full Discord account.
226
226
227
227
### Merging Provisional Accounts for Public Clients
228
228
@@ -255,7 +255,7 @@ client->Authorize(args, [client, codeVerifier](discordpp::ClientResult result, s
255
255
std::cerr << " ❌ Authorization Error: " << result .Error () << std ::endl ;
256
256
} else {
257
257
std::cout << " ✅ Authorization successful! Next step: GetTokenFromProvisionalMerge \n " ;
258
-
258
+
259
259
// Retrieve your external auth token
260
260
std ::string externalAuthToken = GetExternalAuthToken ();
261
261
@@ -290,12 +290,12 @@ If you are not using the [`Client::GetTokenFromProvisionalMerge`] or [`Client::G
290
290
291
291
```python
292
292
import requests
293
-
293
+
294
294
API_ENDPOINT = 'https://discord.com/api/v10'
295
295
CLIENT_ID = '332269999912132097'
296
296
CLIENT_SECRET = '937it3ow87i4ery69876wqire'
297
297
EXTERNAL_AUTH_TYPE = 'OIDC'
298
-
298
+
299
299
def exchange_code_with_merge(code, redirect_uri, external_auth_token):
300
300
data = {
301
301
'grant_type': 'authorization_code',
@@ -316,12 +316,12 @@ def exchange_code_with_merge(code, redirect_uri, external_auth_token):
316
316
317
317
``` python
318
318
import requests
319
-
319
+
320
320
API_ENDPOINT = ' https://discord.com/api/v10'
321
321
CLIENT_ID = ' 332269999912132097'
322
322
CLIENT_SECRET = ' 937it3ow87i4ery69876wqire'
323
323
EXTERNAL_AUTH_TYPE = ' OIDC'
324
-
324
+
325
325
def exchange_device_code_with_merge (device_code ):
326
326
data = {
327
327
' grant_type' : ' urn:ietf:params:oauth:grant-type:device_code' ,
@@ -349,6 +349,16 @@ def exchange_device_code_with_merge(device_code):
349
349
}
350
350
```
351
351
352
+ ### Data Migration During Merging
353
+
354
+ When a user merges their provisional account with a Discord account, the following data is automatically transferred:
355
+
356
+ * ** ✅ Friends** : All In-game and Discord friendships made through the provisional account
357
+ * ** ✅ Lobby Memberships** : Active and historical lobby participation
358
+ * ** ✅ DM Messages** : Direct messages and history
359
+
360
+ This migration ensures users don't lose their social connections built while using the provisional account.
361
+
352
362
---
353
363
354
364
## Unmerging Provisional Accounts
@@ -460,6 +470,19 @@ def unmerge_provisional_account(external_auth_token):
460
470
If you have a server backend, you'll want to use the server-to-server unmerge endpoint rather than the SDK helper method to maintain better security and control over the unmerge process.
461
471
:::
462
472
473
+ ### Data Migration During Unmerging
474
+
475
+ When a user unmerges their account, a new provisional account is created with a new user ID. The relationship transfer follows these rules:
476
+
477
+ * **✅ In-game friends**: All copied to the new provisional account
478
+ * **✅ Discord friends who use this application**: Copied to the provisional account
479
+ * **❌ Discord friends who don't use this application**: Not transferred
480
+ * **❌ DM message history**: Not moved to provisional accounts
481
+
482
+ :::info
483
+ Provisional accounts can have Discord friends, but can only message these friends when actively playing the game.
484
+ :::
485
+
463
486
---
464
487
465
488
## Next Steps
0 commit comments