我已成功在以前版本的 NextJS 中使用页面/api 路由连接到 AWS API Gateway。我正在尝试使用新的应用程序路由器在 app/api/route 中执行相同的操作。但我无法让aws-amplify图书馆工作,即
const {Auth: ssrAuth} = withSSRContext({ req: request }); //works
const user = await ssrAuth.currentAuthenticatedUser(); //fails
Run Code Online (Sandbox Code Playgroud)
这与页面路由器配合得很好,我能够获取用户令牌以将授权者附加到 API 网关请求。
知道为什么吗?请求就在那里,我可以看到带有用户令牌的 cookie。我究竟做错了什么?
非常感谢任何反馈/提示
api-gateway aws-amplify aws-amplify-sdk-js nextjs-dynamic-routing next.js13
对于使用mui-datatables的人的问题。它可以将数据作为字符串数组来使用,但是由于以下错误而无法加载对象数组:bundle.js:126379未捕获(承诺)TypeError:e.map不是函数
import MUIDataTable from "mui-datatables";
class App extends React.Component {
render() {
const columns = ["Name", "Title", "Location", "Age", "Salary"];
const data = [
{name: "Gabby George", title: "Business Analyst", location: "Minneapolis", age: 30, salary: "$100,000"}
];
const options = {
filterType: 'dropdown',
responsive: 'stacked'
};
return (
<MUIDataTable
title={"ACME Employee list"}
data={data}
columns={columns}
options={options}
/>
);
//return <div>a</div>;
}
}
ReactDOM.render(<App />, document.getElementById("root"));
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激!