Redirect to onboarding from auth page (#1640)

* Redirect to onboarding from auth page

* Remove left over trial code
This commit is contained in:
Paulus Schoutsen 2018-09-07 20:13:00 +02:00 committed by GitHub
parent 59010baf89
commit 300425e698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,6 +92,14 @@ class HaAuthorize extends LocalizeLiteMixin(PolymerElement) {
// Fetch auth providers
try {
const response = await window.providersPromise;
const result = await response.json();
// Forward to main screen which will redirect to right onboarding page.
if (response.status === 400 && result.code === 'onboarding_required') {
location.href = '/';
return;
}
const authProviders = await response.json();
if (authProviders.length === 0) {