Migrate athentication from webview to deep linking

This commit is contained in:
Yegor Vialov
2019-10-20 16:45:44 +00:00
parent 085aead36b
commit 520fd6bc38
7 changed files with 41 additions and 40 deletions

View File

@ -59,9 +59,9 @@ class ConnectionManager {
_token = await storage.read(key: "hacl_llt");
Logger.e("Long-lived token read successful");
oauthUrl = "$httpWebHost/auth/authorize?client_id=${Uri.encodeComponent(
'http://ha-client.homemade.systems/')}&redirect_uri=${Uri
'http://ha-client.homemade.systems')}&redirect_uri=${Uri
.encodeComponent(
'http://ha-client.homemade.systems/service/auth_callback.html')}";
'haclient://auth')}";
settingsLoaded = true;
} catch (e) {
completer.completeError(HAError("Error reading login details", actions: [HAErrorAction.tryAgain(type: HAErrorActionType.FULL_RELOAD), HAErrorAction.loginAgain()]));
@ -79,7 +79,7 @@ class ConnectionManager {
if (!stopInit) {
if (_token == null) {
AuthManager().getTempToken(
AuthManager().start(
oauthUrl: oauthUrl
).then((token) {
Logger.d("Token from AuthManager recived");