wip: oauth
This commit is contained in:
parent
0dac7b9785
commit
72b13f5265
7 changed files with 115 additions and 4 deletions
21
server/shared.ts
Normal file
21
server/shared.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { $fetch } from 'ohmyfetch'
|
||||
|
||||
export interface AppInfo {
|
||||
id: string
|
||||
name: string
|
||||
website: string | null
|
||||
redirect_uri: string
|
||||
client_id: string
|
||||
client_secret: string
|
||||
vapid_key: string
|
||||
}
|
||||
|
||||
export const registeredApps: Record<string, AppInfo> = {}
|
||||
|
||||
const promise = $fetch(process.env.APPS_JSON_URL || 'http://localhost:3000/registered-apps.json')
|
||||
.then(r => Object.assign(registeredApps, r))
|
||||
|
||||
export async function getApp(server: string) {
|
||||
await promise
|
||||
return registeredApps[server]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue