Add checkSessionExist in auth
This commit is contained in:
parent
4ebf6b27ba
commit
d76d6135e9
1 changed files with 10 additions and 0 deletions
|
@ -19,6 +19,16 @@ Future<void> addSession(userId, sessionToken) async {
|
|||
await prefs.setString('session', session);
|
||||
}
|
||||
|
||||
Future<bool> checkSessionExist() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
if (prefs.containsKey('session')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Future<void> removeSession() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue