platform/test/auth_token_test.dart
thosakwe 5b7e017f31 +10
2016-11-23 15:37:40 -05:00

16 lines
No EOL
450 B
Dart

import "package:angel_auth/src/auth_token.dart";
import "package:crypto/crypto.dart";
import "package:test/test.dart";
main() async {
final Hmac hmac = new Hmac(sha256, "angel_auth".codeUnits);
test("sample serialization", () {
var token = new AuthToken(ipAddress: "localhost", userId: "thosakwe");
var jwt = token.serialize(hmac);
print(jwt);
var parsed = new AuthToken.validate(jwt, hmac);
print(parsed.toJson());
});
}