this commit fixes #146 by making auth token to always be unique to device, it also adds submodule for translations however isn't working yet.

This commit is contained in:
Kosh 2017-03-13 23:32:03 +08:00
parent 3e6bf27b56
commit 92cfe15270
5 changed files with 6 additions and 4 deletions

4
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "/app/src/res/"]
path = /app/src/res/
[submodule "app/src/res/translations"]
path = app/src/res/translations/
url = https://github.com/k0shk0sh/FastHub-translations.git

View File

@ -49,6 +49,7 @@ android {
"src/main/res/layouts/main_layouts",
"src/main/res/layouts/row_layouts",
"src/main/res/layouts/other_layouts",
"src/main/res/translations",
"src/main/res"
]
}

View File

@ -1,5 +1,6 @@
package com.fastaccess.ui.modules.login;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@ -59,10 +60,10 @@ class LoginPresenter extends BasePresenter<LoginMvp.View> implements LoginMvp.Pr
String authToken = Credentials.basic(username, password);
AuthModel authModel = new AuthModel();
authModel.setScopes(Arrays.asList("user", "repo", "gist", "notifications"));
authModel.setNote(BuildConfig.APPLICATION_ID + "-" + authToken);//make it unique to FastHub.
authModel.setNote(BuildConfig.APPLICATION_ID + "-" + authToken + "-" + Build.MODEL);//make it unique to FastHub.
authModel.setClientSecret(BuildConfig.GITHUB_SECRET);
UUID uuid = UUID.randomUUID();
String fingerprint = BuildConfig.APPLICATION_ID + " - " + uuid;
String fingerprint = BuildConfig.APPLICATION_ID + " - " + uuid + "-" + Build.MODEL;
Observable<AccessTokenModel> loginCall = LoginProvider.getLoginRestService(authToken)
.login(BuildConfig.GITHUB_CLIENT_ID, fingerprint, authModel);
if (!InputHelper.isEmpty(twoFactorCode)) {