我在他们的免费层 ( https://cloud.google.com/free/ )上使用谷歌云平台来运行一个可以公开访问的网络服务器(外部)。我已经在他们的免费套餐下设置了所有内容:F1-micro 实例、具有标准路由的标准 VM 实例等,所以我没有为此付费。
根据这个:https : //cloud.google.com/compute/all-pricing#ipaddress
从 2020 年 1 月 1 日起,Google 将开始以每小时 0.004 美元的价格对标准 VM 实例上使用的静态和临时 IP 地址收费。
是否有任何可能的方法仍然拥有一个完全免费的网络服务器,可以使用 Google Cloud Platform 进行公共访问,或者最低成本为每月 2.92 美元,因为它们将收取使用外部 IP 地址的费用(又名,没有真正的免费层级) 2020 年 1 月 1 日之后存在)?
根据Next Auth 文档,我可以/authorize通过 的第三个参数将其他参数传递到端点signIn()。
他们展示了两个例子:
signIn("identity-server4", null, { prompt: "login" }) // always ask the user to re-authenticate
signIn("auth0", null, { login_hint: "info@example.com" }) // hints the e-mail address to the provider
Run Code Online (Sandbox Code Playgroud)
但是,没有完整的工作示例,我无法读取我在/api/auth/[...nextauth].js. 任何人都可以告诉我如何读取这些附加参数,例如signIn() callback?
这是一个简单的例子来说明我的意思:
/index.jsx
import { useState } from "react"
import { signIn } from "next-auth/react"
export default function EmailLink() {
const [email, setEmail] = useState('')
const submitUser = (e) => {
e.preventDefault()
signIn('email',
{email, callbackUrl: '/dashboard', redirect: …Run Code Online (Sandbox Code Playgroud)