Hi all, so I want to use a custom URL for the success parameter, but I still want to get the session id query.
Here is my current code:
Swift
let newSession =tryawait account.createOAuth2Session(
provider:"apple",
success:"path/{sessionId}",
)
How I can access the session id if I'm using a custom url for the success parameter?
Summary
The user wants to use a custom URL for the success parameter while still being able to access the session ID. They are currently using the code snippet:
```swift
let newSession = try await account.createOAuth2Session(
provider: "apple",
success: "path/{sessionId}",
)
```
The recommend solution is to use the following URL as the success parameter:
```
appwrite-callback-[PROJECT_ID]://localhost/auth/oauth2/success
```
Alternatively, they can host their own page that redirects the user like the console does. The SDK automatically handles the session, so the user should not manually try to
Drake
Dec 30, 2023, 21:04
For apple, using our SDK, you should omit the success parameter
Drake
Dec 30, 2023, 21:04
The SDK automatically handles the session
ashidiqidimas
Apple Developer
Dec 31, 2023, 03:54
But if I omit the success parameter, the users will see this error screen. If I pass the success parameter, this screen will not shown
jaydenclerk
Dec 31, 2023, 04:29
Happened to me
Drake
Dec 31, 2023, 05:11
What shows instead?
ashidiqidimas
Apple Developer
Dec 31, 2023, 06:38
Nothing will be shown. It will just show the pop up to open my app, which I guess is the expected behavior? but when I open my app, it will crash because it can't get the cookies from the redirect URL
Drake
Dec 31, 2023, 18:03
You're not supposed to try and get the cookie. Appwrite SDK handles it automatically
ashidiqidimas
Apple Developer
Jan 3, 2024, 07:19
So, do you have any suggestion on how to solve this missing redirect URL error?