feat(mobile): ios selfhost server support (#11563)

This commit is contained in:
CatsJuice
2025-04-14 01:13:23 +00:00
parent e1cb8198f1
commit d6b4ee8172
9 changed files with 363 additions and 73 deletions
+11 -1
View File
@@ -337,6 +337,7 @@ CapacitorApp.addListener('appUrlOpen', ({ url }) => {
if (urlObj.hostname === 'authentication') {
const method = urlObj.searchParams.get('method');
const payload = JSON.parse(urlObj.searchParams.get('payload') ?? 'false');
const serverBaseUrl = urlObj.searchParams.get('server');
if (
!method ||
@@ -347,9 +348,18 @@ CapacitorApp.addListener('appUrlOpen', ({ url }) => {
return;
}
const authService = frameworkProvider
let authService = frameworkProvider
.get(DefaultServerService)
.server.scope.get(AuthService);
if (serverBaseUrl) {
const serversService = frameworkProvider.get(ServersService);
const server = serversService.getServerByBaseUrl(serverBaseUrl);
if (server) {
authService = server.scope.get(AuthService);
}
}
if (method === 'oauth') {
authService
.signInOauth(payload.code, payload.state, payload.provider)