-
Notifications
You must be signed in to change notification settings - Fork 12
Support custom PDSs #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
dpaulino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | ||
| var authUrl = $"{UrlConstants.BlueskyBaseUrl}/{UrlConstants.AuthPath}"; | ||
| _baseUrl = baseUrl; | ||
| var authUrl = $"{baseUrl}/{UrlConstants.AuthPath}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This url is resolving to bsky.social/<authPath>. This is leading to an HTTP error because the url is missing https://.
| public async Task<Result<AuthResponse>> RefreshAsync(string refreshToken, string baseUrl = UrlConstants.BlueskyBaseUrl) | ||
| { | ||
| var refreshUrl = $"{UrlConstants.BlueskyBaseUrl}/{UrlConstants.RefreshAuthPath}"; | ||
| _baseUrl = baseUrl; | ||
| var refreshUrl = $"{baseUrl}/{UrlConstants.RefreshAuthPath}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend making the following changes:
- change new parameter to
string? baseUrl = null. Make sure to apply this change in the interface as well. - Then on line 23, do this
_baseUrl = baseUrl ?? UrlConstants.BlueskyBaseUrl; - Then make sure on line 24 to use the correct variable:
{_baseUrl}/{UrlConstants.RefreshAuthPath}
|
|
||
| /// <inheritdoc/> | ||
| public async Task<Result<AuthResponse>> AuthenticateAsync(string identifer, string appPassword) | ||
| public async Task<Result<AuthResponse>> AuthenticateAsync(string identifer, string appPassword, string baseUrl = UrlConstants.BlueskyBaseUrl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments here as the comment on RefreshAsync
| } | ||
|
|
||
| return await SignInWithValidatedCredentialsAsync(userHandleOrEmail, password); | ||
| return await SignInWithValidatedCredentialsAsync(userHandleOrEmail, password, baseUrl ?? "bsky.social"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After making my recommended changes on BlueskyApiClient.cs, then we don't need this null coalesce anymore. In fact, this is one of the reasons why the PR had an http error
| return await SignInWithValidatedCredentialsAsync(userHandleOrEmail, password, baseUrl ?? "bsky.social"); | |
| return await SignInWithValidatedCredentialsAsync(userHandleOrEmail, password, baseUrl); |
| private async Task<Result<AuthResponse>> SignInWithValidatedCredentialsAsync(string identifier, string password, string? baseUrl) | ||
| { | ||
| Result<AuthResponse> result = await _apiClient.AuthenticateAsync(identifier, password); | ||
| Result<AuthResponse> result = await _apiClient.AuthenticateAsync(identifier, password, baseUrl ?? "bsky.social"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Result<AuthResponse> result = await _apiClient.AuthenticateAsync(identifier, password, baseUrl ?? "bsky.social"); | |
| Result<AuthResponse> result = await _apiClient.AuthenticateAsync(identifier, password, baseUrl); |
|
just dropping this in here: you don't need UI for users to enter a PDS, it can be resolved from the handle |
|
Sorry for the radio silence - I no longer have either a windows system or a custom PDS to test with, so if someone else wants to pick this up, feel free, but I don't really have a way to keep working on this. Sorry about that. |

Closes #7
Currently no translations for the new UI other than English.