Ejemplo n.º 1
0
    def post(self):
        if "id" not in session:
            raise Unauthorized()

        user = UserService.get(session["id"])

        return authorization.create_authorization_response(grant_user=user)
Ejemplo n.º 2
0
    def delete(self):
        if "id" not in session:
            raise Unauthorized()

        user = UserService.get(session["id"])
        del session["id"]

        return {"data": user.to_dict()}
Ejemplo n.º 3
0
    def get(self):
        if "id" not in session:
            raise Unauthorized()

        user = UserService.get(session["id"])

        try:
            grant = authorization.validate_consent_request(end_user=user)
        except OAuth2Error as e:
            return e.error

        return render_template('authorize.html', user=user, grant=grant)