mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-30 00:29:46 +08:00
feat(mobile): ios selfhost server support (#11563)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user