-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use dynamic metadata and remove old api endpoints
- Loading branch information
Showing
6 changed files
with
38 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { OAUTH_SCOPE } from '~/constants' | ||
|
||
export default defineEventHandler(async (event) => { | ||
const requestUrl = getRequestURL(event) | ||
|
||
const proto = getHeader(event, 'x-forwarded-proto') | ||
const host = getHeader(event, 'x-forwarded-host') | ||
if (proto && host) { | ||
const { protocol, hostname, port } = new URL(`${proto}://${host}`) | ||
requestUrl.protocol = protocol | ||
requestUrl.hostname = hostname | ||
requestUrl.port = port | ||
} | ||
|
||
return { | ||
client_id: requestUrl.href, | ||
client_uri: new URL('/', requestUrl).href, | ||
redirect_uris: [new URL('/', requestUrl).href], | ||
response_types: ['code'], | ||
grant_types: ['authorization_code'], | ||
token_endpoint_auth_method: 'none', | ||
scope: OAUTH_SCOPE, | ||
dpop_bound_access_tokens: true, | ||
application_type: 'web', | ||
client_name: 'Nimbus', | ||
logo_uri: new URL( | ||
'/pwa-192x192.png', | ||
requestUrl, | ||
).href, | ||
// tos_uri: 'https://example.com/tos', | ||
// policy_uri: 'https://example.com/policy', | ||
// jwks_uri: 'https://example.com/jwks', | ||
} | ||
}) |