Mostly working websocket stuff, some message weirdness at the moment...
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import 'package:backend/database.dart';
|
||||
import 'package:backend/service/db_access.dart';
|
||||
import 'package:backend/db/database.dart';
|
||||
import 'package:backend/db/db_access.dart';
|
||||
import 'package:backend/utils/environment.dart';
|
||||
import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
@@ -25,7 +25,13 @@ class Authenticator {
|
||||
final iat = DateTime.now().millisecondsSinceEpoch ~/ 1000;
|
||||
final jwt = JWT(
|
||||
header: {'algo': 'HS256'},
|
||||
JWTBody(uuid: newUser.uuid, roomUuid: newUser.gameRoomUuid, iat: iat, exp: iat + expTimeSecs).toJson(),
|
||||
JWTBody(
|
||||
uuid: newUser.uuid,
|
||||
roomUuid: newUser.gameRoomUuid,
|
||||
roomCode: req.roomCode,
|
||||
iat: iat,
|
||||
exp: iat + expTimeSecs,
|
||||
).toJson(),
|
||||
);
|
||||
|
||||
return (jwt.sign(SecretKey(jwtSecret!)), newUser);
|
||||
|
||||
Reference in New Issue
Block a user