Skip to content

Commit

Permalink
fix(nextcloud login flow): Use standalone browser on iOS
Browse files Browse the repository at this point in the history
to enable cookies

fixes #1515

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Jan 7, 2024
1 parent 05f9220 commit f3072c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ui/store/native/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Logger from '../../../lib/Logger'
import AdapterFactory from '../../../lib/AdapterFactory'
import Controller from '../../../lib/Controller'
import { i18n } from '../../../lib/native/I18n'
import { CapacitorHttp as Http } from '@capacitor/core'
import { Capacitor, CapacitorHttp as Http } from '@capacitor/core'
import { Share } from '@capacitor/share'
import Html from '../../../lib/serializers/Html'
import { Bookmark, Folder } from '../../../lib/Tree'
Expand Down Expand Up @@ -200,7 +200,9 @@ export const actionsDefinition = {
throw new Error(i18n.getMessage('LabelLoginFlowError'))
}
let json = res.data
const browserWindow = await window.open(json.login, '_blank', 'toolbar=no,presentationstyle=pagesheet')
// iOS browser doesn't allow 3rd party cookies, so we have to open a standalone browser
const target = Capacitor.getPlatform() === 'ios'? '_system' : '_blank'

Check failure on line 204 in src/ui/store/native/actions.js

View workflow job for this annotation

GitHub Actions / js node20.x

Operator '?' must be spaced

Check failure on line 204 in src/ui/store/native/actions.js

View workflow job for this annotation

GitHub Actions / init (20.x, 10.x)

Operator '?' must be spaced
const browserWindow = await window.open(json.login, target, 'toolbar=no,presentationstyle=pagesheet')
do {
await new Promise(resolve => setTimeout(resolve, 1000))
try {
Expand Down

0 comments on commit f3072c2

Please sign in to comment.