next.js - 渲染服务器端时如何在 apollo 中使用来自 next-auth/react 的 GetSession?
问题描述
在为 apollo 客户端创建链接时,如何使用 getSession 检索令牌?它与 getSession 一起在客户端工作得很好。服务器端它重新调整 null。我知道 getSession 通常需要一个 req 参数,但 apollo 客户端文件中不存在该参数。
在尝试使用会话中的令牌获取 getServerSideProps (nextjs) 中的数据时。
解决方案
推荐阅读
- python - 我的 while 循环没有结束。为什么会这样?
- google-sheets - 仅当今天小于或等于 Google 表格中当月的最后一天时,如何计算今天的日期?
- ios - App Store Connect 上传错误“您没有获得云管理分发证书的访问权限”
- python - 为什么这个 pysimplegui 不能正常工作
- java - 类的方法没有给出预期的结果
- r - R中的基准矩阵函数和计算
- typescript - 类型“{}”不可分配给类型“IntrinsicAttributes”
vite+ ts - angular - 尝试创建组件时出现以下错误:ng new routing-demo
- python - 如何在列表中选择随机索引
- matrix - 如何从向量制作对角矩阵