Fix expired calculation.
Add user authentication.