LocalSessionUtils
interface LocalSessionUtils
The LocalSessionUtils
class is useful to manage the local sessions of the user, so manage the credentials of the user and all his/her personal data like profile pic, email and password
Author
N7ghtm4r3 - Tecknobit
Types
Link copied to clipboard
class NovaSession
The
NovaSession
record is useful to store and work with the local sessionsProperties
Link copied to clipboard
val CREATE_SESSIONS_TABLE: String = "CREATE TABLE IF NOT EXISTS sessions (id VARCHAR(32) PRIMARY KEY,
token VARCHAR(32) NOT NULL,
profile_pic TEXT NOT NULL,
name VARCHAR(20) NOT NULL,
surname VARCHAR(30) NOT NULL,
email VARCHAR(75) NOT NULL,
password VARCHAR(32) NOT NULL,
host_address VARCHAR(75) NOT NULL,
role VARCHAR(8) NOT NULL,
is_active BOOL DEFAULT 0,
language VARCHAR(2) NOT NULL
);"
CREATE_SESSIONS_TABLE
the query to create the SESSIONS_TABLELink copied to clipboard
DATABASE_NAME
the name of the local databaseLink copied to clipboard
SESSIONS_TABLE
the name of the sessions tableFunctions
Link copied to clipboard
Method to change the current active session with a new one specified by the identifier
Link copied to clipboard
Method to change the email value of the current session
Link copied to clipboard
Method to change the language value of the current session
Link copied to clipboard
Method to change the password value of the current session
Link copied to clipboard
Method to change the profile pic value of the current session
Link copied to clipboard
Method to change a value of the current session
Link copied to clipboard
Method to delete all the local sessions, used when the user executes a logout or the account deletion No-any params required
Link copied to clipboard
Method to delete a specific local session specified by the identifier of the user in that session
Link copied to clipboard
Method to get the current active local session No-any params required
Link copied to clipboard
Method to get the local session specified by the identifier of the user in that session
Link copied to clipboard
Method to list all the local sessions of the user.
Link copied to clipboard
Link copied to clipboard
Method to set the current active session as inactive No-any params required
Link copied to clipboard
Method to set as the active session a new session