def METHOD_NAME(
    self, code: str, request: OAuth2Request
) -> OAuth2AuthorizationCode:
    auth_code = OAuth2AuthorizationCode(
        code=code,
        client_id=request.client.client_id,
        redirect_uri=request.redirect_uri,
        scope=request.scope,
        user_id=request.user.id,
    )
    db.session.add(auth_code)
    db.session.commit()
    return auth_code