changed flash keys for authentication
added tests for user role checks and fixed bugs