Support custom PDSs - #45
Conversation
| { | ||
| var authUrl = $"{UrlConstants.BlueskyBaseUrl}/{UrlConstants.AuthPath}"; | ||
| _baseUrl = baseUrl; | ||
| var authUrl = $"{baseUrl}/{UrlConstants.AuthPath}"; |
There was a problem hiding this comment.
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.
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.
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.
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.
| 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.