Skip to content

Instantly share code, notes, and snippets.

@jwngr
Last active November 26, 2018 20:21
Show Gist options
  • Save jwngr/ab07d225f1f2ec033988fbb7e361b448 to your computer and use it in GitHub Desktop.
Save jwngr/ab07d225f1f2ec033988fbb7e361b448 to your computer and use it in GitHub Desktop.
Implementing Firebase Auth Session Durations - Firestore Rules #3
function isSessionValid() {
return (request.auth.token.auth_time + (60 * 60 * 24 * 30)) * 1000 > request.time.toMillis();
}
allow read: if isSessionValid();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment