PluralsightコースのJohnPapaと同じように、「Amplifyjs」を使用してAJAXリクエストを処理しようとしていますが、認証に問題があります。
フォーム認証を使用しています。すべてが正常に動作します。
私の問題は、認証されていないリクエストにあります。「amplifyjs」がエラー関数にhttpコード(401、403 ...)を返して、認証されなかったために失敗したリクエストと、ビジネスロジックを満たしていないために失敗したリクエストを区別する方法が見つかりません。
リクエストの例は次のとおりです。
amplify.request.define("products", "ajax", {
url: "/api/Products",
datatype: "json",
type: "GET"
});
amplify.request({
resourceId: "products",
success: callbacks.success,
error: function (datos, status) {
//somecode
}
});
ありがとうございました。