You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 22, 2022. It is now read-only.
I have a web app that logins through oauth2 using feathers with passport.
This web app has a link that redirects to the oauth login, when the login is successfull the browser goes back to the original page and returns a token for the login.
This works on a normal browser but on a cordova / phonegap app don't because the callback successRedirect of the oauth can't redirect back to the app.
How I can make this work on latest android and ios with wkwebview?
The text was updated successfully, but these errors were encountered:
After that you can log in through oauth with this method, (after oauth has been configured on the backend with the instructions of the official docs feathers)
cordovaOauthLogin(){// Open browser for linkedin oauth loginconstbrowser=window.cordova.InAppBrowser.open('http://localhost:3060/auth/linkedin','_blank','location=no,clearsessioncache=yes,clearcache=yes')// Starts event to detect when the login has finished// and the feathers cookie is readybrowser.addEventListener('loadstop',event=>{// Detect the successRedirect from feathersif(event.url==='http://localhost:8066/')browser.executeScript({code: 'document.cookie.valueOf("feathers-jwt")'},asynccookie=>{// Extract and set feathers-jwt token from cookieconsttoken=`${cookie}`.slice(13)localStorage.setItem('feathers-jwt',token)// Close the InAppBrowserbrowser.close()// Login after token is ready on the localStorageawaitthis.$store.dispatch('auth/authenticate')this.$router.replace({name: 'SelectProfile'})})})},
This was tested for ios and android.
Someone knows how to get rid of the callbacks when using an addEventListener?
I have a web app that logins through oauth2 using feathers with passport.
This web app has a link that redirects to the oauth login, when the login is successfull the browser goes back to the original page and returns a token for the login.
This works on a normal browser but on a cordova / phonegap app don't because the callback successRedirect of the oauth can't redirect back to the app.
How I can make this work on latest android and ios with wkwebview?
The text was updated successfully, but these errors were encountered: