mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 02:38:47 +00:00
Login updates
Skip the login screen if the user is logged in
This commit is contained in:
parent
9c9219bd6c
commit
709812d0c1
@ -8,10 +8,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class TestListDelete {
|
public class TestListDelete {
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testListDeleterValid() {
|
|
||||||
testListDeleterCore(false, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testListDeleterWOAccess() {
|
public void testListDeleterWOAccess() {
|
||||||
|
|||||||
@ -69,6 +69,12 @@ public class AuthManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void nullify() {
|
public void nullify() {
|
||||||
|
authSession = null;
|
||||||
|
authSignUpResult = null;
|
||||||
|
authSignInResult = null;
|
||||||
|
authResetPasswordResult = null;
|
||||||
|
authError = null;
|
||||||
|
email = null;
|
||||||
email = null;
|
email = null;
|
||||||
password = null;
|
password = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import androidx.navigation.NavController;
|
|||||||
import androidx.navigation.Navigation;
|
import androidx.navigation.Navigation;
|
||||||
import androidx.navigation.ui.AppBarConfiguration;
|
import androidx.navigation.ui.AppBarConfiguration;
|
||||||
import androidx.navigation.ui.NavigationUI;
|
import androidx.navigation.ui.NavigationUI;
|
||||||
|
|
||||||
import com.amplifyframework.auth.AuthException;
|
import com.amplifyframework.auth.AuthException;
|
||||||
import com.example.listify.data.Item;
|
import com.example.listify.data.Item;
|
||||||
import com.example.listify.data.ItemSearch;
|
import com.example.listify.data.ItemSearch;
|
||||||
@ -23,15 +22,16 @@ import com.example.listify.data.List;
|
|||||||
import com.example.listify.data.ListEntry;
|
import com.example.listify.data.ListEntry;
|
||||||
import com.example.listify.ui.LoginPage;
|
import com.example.listify.ui.LoginPage;
|
||||||
import com.google.android.material.navigation.NavigationView;
|
import com.google.android.material.navigation.NavigationView;
|
||||||
import static com.example.listify.SplashActivity.showSplash;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import static com.example.listify.SplashActivity.showSplash;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity implements CreateListDialogFragment.OnNewListListener {
|
public class MainActivity extends AppCompatActivity implements CreateListDialogFragment.OnNewListListener {
|
||||||
private AppBarConfiguration mAppBarConfiguration;
|
private AppBarConfiguration mAppBarConfiguration;
|
||||||
public static AuthManager am = new AuthManager();
|
public static AuthManager am = new AuthManager();
|
||||||
@ -61,7 +61,8 @@ public class MainActivity extends AppCompatActivity implements CreateListDialogF
|
|||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(am.getEmail() == null) {
|
if(am.getUserToken().equals("")) {
|
||||||
|
am.nullify();
|
||||||
Intent intent = new Intent(MainActivity.this, LoginPage.class);
|
Intent intent = new Intent(MainActivity.this, LoginPage.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user