~cadence/Frames

7c20767e41564a1e63aa5e91636026a47d41f23b — Cadence Ember 1 year, 10 months ago 34f5bd6
Change more text strings to full error pages
2 files changed, 3 insertions(+), 3 deletions(-)

M api/auth.js
M pug/error.pug
M api/auth.js => api/auth.js +2 -2
@@ 32,7 32,7 @@ module.exports = [
					row = await auth.getOrCreateApplication(instance)
				} catch (e) {
					console.error(e)
					return message(400, "Input is not a running fediverse instance.")
					return render(400, "pug/error.pug", {message: "Input is not a running fediverse instance.", userFault: true})
				}

				return render(200, "pug/auth-code.pug", {instance, auth_url: row.auth_url, referrer})


@@ 61,7 61,7 @@ module.exports = [
					data = await auth.createToken(row, params.get("code"))
				} catch (e) {
					console.error(e)
					return message(400, "Code wasn't accepted. Either you submitted garbage, or already submitted this code (codes can only be used once).")
					return render(400, "pug/error.pug", {message: "Code wasn't accepted. Either you submitted garbage, or already submitted this code (codes can only be used once).", userFault: true})
				}

				return redirect(303, referrer, {"set-cookie": `frames_token=${data.cookie}; Path=/; Max-Age=${4000*24*60*60}; HttpOnly; SameSite=Lax`})

M pug/error.pug => pug/error.pug +1 -1
@@ 2,6 2,6 @@ extends includes/layout.pug

block main
  unless userFault
    p Something's gone wrong, and it looks like it's Frames' fault.
    p Something's gone wrong, and it looks like it's a problem with Frames, not you.
  p= message
  p Not expecting this error? #[a(href="https://is.badat.dev/users/cadence") Ask for help.]