Apps: get the redirect_uri into the app

This commit is contained in:
Alex Gleason 2023-04-30 12:39:47 -05:00
parent 9734d0a961
commit d860ef7f98
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 12 additions and 2 deletions

View File

@ -14,8 +14,18 @@ const FAKE_APP = {
vapid_key: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=',
};
function createAppController(c: Context) {
return c.json(FAKE_APP);
async function createAppController(c: Context) {
// TODO: Handle both formData and json. 422 on parsing error.
try {
const { redirect_uris } = await c.req.json();
return c.json({
...FAKE_APP,
redirect_uri: redirect_uris || FAKE_APP.redirect_uri,
});
} catch (_e) {
return c.json(FAKE_APP);
}
}
function appCredentialsController(c: Context) {