tocken name with Device ID (#184)
This commit is contained in:
parent
26b93a4280
commit
04073ac873
@ -68,7 +68,6 @@
|
|||||||
<activity android:name=".activities.OpenRepoInBrowserActivity" />
|
<activity android:name=".activities.OpenRepoInBrowserActivity" />
|
||||||
</application>
|
</application>
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -38,6 +38,7 @@ import java.util.Objects;
|
|||||||
import okhttp3.Credentials;
|
import okhttp3.Credentials;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
|
import android.provider.Settings.Secure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author M M Arif
|
* Author M M Arif
|
||||||
@ -51,6 +52,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|||||||
private TextView otpInfo;
|
private TextView otpInfo;
|
||||||
private RadioGroup loginMethod;
|
private RadioGroup loginMethod;
|
||||||
final Context ctx = this;
|
final Context ctx = this;
|
||||||
|
private String device_id = "token";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -142,6 +144,8 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|||||||
|
|
||||||
loginButton.setOnClickListener(loginListener);
|
loginButton.setOnClickListener(loginListener);
|
||||||
|
|
||||||
|
device_id = Integer.toHexString(Secure.getString(ctx.getContentResolver(), Secure.ANDROID_ID).hashCode());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -561,7 +565,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|||||||
|
|
||||||
if(tinyDb.getString(loginUid + "-token").isEmpty() || !setTokenFlag) {
|
if(tinyDb.getString(loginUid + "-token").isEmpty() || !setTokenFlag) {
|
||||||
|
|
||||||
UserTokens createUserToken = new UserTokens("gitnex-app-token");
|
UserTokens createUserToken = new UserTokens("gitnex-app-" + device_id);
|
||||||
|
|
||||||
Call<UserTokens> callCreateToken;
|
Call<UserTokens> callCreateToken;
|
||||||
if(loginOTP != 0) {
|
if(loginOTP != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user