Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #358.
This PR expects the server to be using https://github.com/lockdown-systems/cyd-server/pull/96.
Before, when you clicked the menu and clicked "Sign in to Cyd to access premium features", it would show the sign in modal, and then load dash inside of a webview in the app. Now, it opens dash in your default web browser by loading
${dashURL}/#/native-login/${userEmail}/${deviceToken}/manage
. This route on the server automatically logs the user in using the app's device token.For example, when you try using premium features and you're not logged in, it looks like this (which is how it looked before too):
When you click "Sign In" it opens the sign in modal, and you can sign in with an email. Before it would bring the user to dash in a webview, but now it opens dash in your browser and then looks like this:
Clicking "Manage My Account" opens dash in the browser again, and clicking "I've Upgraded" re-checks to see if you have premium. If you click it and you don't have premium, it shows this message for 5 seconds:
Over in dash, if you upgrade to premium, and then back in the app click "I've Upgraded", it brings you to the final page:
So the main difference is now we have an extra step. Whereas before, when the user upgrades to premium it would automatically bring them to the "Thanks for upgrading" screen, now they have to upgrade to premium in their browser and then manually click "I've Upgraded".
But this also greatly simplifies dash, and the app's interactions with it. We no longer have to be in a situation where the user is trying to manage their account within the app but they don't have a back button, or they can't open a Stripe receipt because it tries to open in a new tab, or any other problem that might arise when using dash in a webview instead of a real web browser.