Created
October 12, 2014 15:12
-
-
Save ThomasLocke/5ba07e9ffbd689399fd4 to your computer and use it in GitHub Desktop.
shelf.middleware.token.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library shelfmiddleware.token; | |
final List<String> _validTokens = new List<String>(); | |
bool isValid(String token) => _validTokens.contains(token); | |
String getToken() { | |
final String token = new DateTime.now().millisecondsSinceEpoch.toString(); | |
_validTokens.add(new DateTime.now().millisecondsSinceEpoch.toString()); | |
return token; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment