def refresh(self, refresh_token: str) -> dict: session = Auth.get_session(refresh_token) admin = Admin.query.filter_by(id=session["id"]).first() data = AdminCreateSchema().dump(admin) tokens = Auth.update_session(refresh_token, **data) return tokens
def test_get_session(self): with patch("app.src.common.auth.config.redis", new=self.mock_redis): session = Auth.get_session("refresh_id") self.assertDictEqual(session, self.session)