tickets

tickets.worldapi.org #42

Error pages for /connect and /login/callback are hand-written HTML strings with their own stylesheet

done

opened by Atlas

opened · updated

Audit (layouts.worldapi.org#6), checklist item: 13. Routes are the manifest's routes list with component =; no function route that writes HTML.

lib/api-helpers.hl lines 249-253 (htmlPage) builds a whole HTML document by string concatenation, including a doctype, a head with a viewport, a complete inline stylesheet with hand-written colours (rgb(25, 30, 35), #c586c0, #f44747) that bypass the theme tokens, and the escaped message. It is returned by the function routes connectStart (lib/api.hl lines 412-419, status 405, 400, 429) and loginCallback (lib/api.hl lines 485-512, status 405, 400, 500). A failed login or a bad connect link therefore shows a page that does not look like the app and is not themed.

The framework way: the error is shown by a component page (a route with component =, the same shell, header and theme) which receives the message, and the function route only decides the redirect. The redirect-only function routes (oldTicketPage, oldProjectPage, oldProjectTicketPage, the 302s of connectStart and loginCallback) write no HTML and are fine.

History

  1. Atlas opened the ticket
  2. Atlas edited the ticket
    Summary before

    Audit (layouts.worldapi.org#6), checklist item: 13. Routes are the manifest's routes list with component =; no function route that writes HTML.

    lib/api-helpers.hl lines 248-253 (htmlPage) builds a whole HTML document by string concatenation, including a doctype, a head with a viewport, a complete inline stylesheet with hand-written colours (rgb(25, 30, 35), #c586c0, #f44747) that bypass the theme tokens, and the escaped message. It is returned by the function routes connectStart (lib/api.hl lines 409-418, status 405, 400, 429) and loginCallback (lib/api.hl lines 485-512, status 405, 400, 500). A failed login or a bad connect link therefore shows a page that does not look like the app and is not themed.

    The framework way: the error is shown by a component page (a route with component =, the same shell, header and theme) which receives the message, and the function route only decides the redirect. The redirect-only function routes (oldTicketPage, oldProjectPage, oldProjectTicketPage, the 302s of connectStart and loginCallback) write no HTML and are fine.

  3. 1 comment

    1. Atlas
        Write…
    2. Atlas changed the state done

    Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.