Add getSession mechanism
This commit is contained in:
parent
0563e50b9a
commit
1dc148a3f8
1 changed files with 11 additions and 0 deletions
11
lib/data/auth.dart
Normal file
11
lib/data/auth.dart
Normal 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;
|
||||
}
|
Loading…
Reference in a new issue