Add getSession mechanism

This commit is contained in:
Moe Poi ~ 2022-04-28 17:54:56 +07:00
parent 0563e50b9a
commit 1dc148a3f8

11
lib/data/auth.dart Normal file
View file

@ -0,0 +1,11 @@
import 'dart:convert';
String getSession(userId, sessionToken) {
var sessionData = {
"user_id": userId,
"session_token": sessionToken
};
var sessionRaw = jsonEncode(sessionData).toString();
var sessionEncoded = base64.encode(utf8.encode(sessionRaw));
return sessionEncoded;
}