kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/715/head
rodzic
ecd8f803bc
commit
2c82bf28a6
|
@ -27,16 +27,11 @@ export async function auth({
|
||||||
const port = await getPort({ port: preferredPort })
|
const port = await getPort({ port: preferredPort })
|
||||||
const app = new Hono()
|
const app = new Hono()
|
||||||
|
|
||||||
if (port !== preferredPort) {
|
|
||||||
throw new Error(
|
|
||||||
`Port ${preferredPort} is required to sign in with ${providerLabel}, but it is already in use.`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const redirectUri = `http://localhost:${port}/callback/${provider}/success`
|
const redirectUri = `http://localhost:${port}/callback/${provider}/success`
|
||||||
let _resolveAuth: any
|
let _resolveAuth: any
|
||||||
let _rejectAuth: any
|
let _rejectAuth: any
|
||||||
|
|
||||||
|
// NOTE: Promise.withResolvers requires Node.js 22+
|
||||||
const authP = new Promise<AuthSession>((resolve, reject) => {
|
const authP = new Promise<AuthSession>((resolve, reject) => {
|
||||||
_resolveAuth = resolve
|
_resolveAuth = resolve
|
||||||
_rejectAuth = reject
|
_rejectAuth = reject
|
||||||
|
|
Ładowanie…
Reference in New Issue