diff --git a/packages/plugin-default-pages/src/index.ts b/packages/plugin-default-pages/src/index.ts index 16bd6fd..16262c3 100644 --- a/packages/plugin-default-pages/src/index.ts +++ b/packages/plugin-default-pages/src/index.ts @@ -1,5 +1,5 @@ import { Origami, Renderer, Route } from '@origami/core-lib'; -import {FORBIDDEN, INTERNAL_SERVER_ERROR, NOT_FOUND} from 'http-status-codes'; +import {FORBIDDEN, INTERNAL_SERVER_ERROR, NOT_FOUND, UNAUTHORIZED} from 'http-status-codes'; import path from 'path'; const index: Origami.Server.RequestHandler = async (req, res, next) => { @@ -32,6 +32,12 @@ const index: Origami.Server.RequestHandler = async (req, res, next) => { data = { title: 'Origami' }; break; + case '/unauthorized': + case '/401': + file = 'unauthorized.html'; + res.status(UNAUTHORIZED); + break; + case '/forbidden': case '/403': file = 'forbidden.html'; diff --git a/packages/plugin-default-pages/static/401/background.svg b/packages/plugin-default-pages/static/401/background.svg new file mode 100644 index 0000000..69858d7 --- /dev/null +++ b/packages/plugin-default-pages/static/401/background.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/plugin-default-pages/static/error.css b/packages/plugin-default-pages/static/error.css new file mode 100644 index 0000000..f558e2f --- /dev/null +++ b/packages/plugin-default-pages/static/error.css @@ -0,0 +1,45 @@ +body { + background: var(--color-white); + padding: var(--size-main); +} + +a.logo { + position: fixed; + top: var(--size-small); + left: var(--size-small); + z-index: 100; +} +a.button { + padding: 0 var(--size-main); +} + +h1 { + font-weight: 700; + font-size: 3.6rem; +} + +p { + margin: 1rem auto; + margin-bottom: var(--size-medium); + max-width: 68rem; + font-size: var(--font-size-large); + color: var(--color-grey-500); +} + +img.banner { + max-width: 68rem; + margin-top: 20%; +} + + +@media screen and (min-width: 640px) { + img.banner { + margin-top: 5vh; + } + + a.logo { + top: var(--size-large); + left: var(--size-large); + } +} + diff --git a/packages/plugin-default-pages/templates/forbidden.html b/packages/plugin-default-pages/templates/forbidden.html index fb89517..68c9919 100644 --- a/packages/plugin-default-pages/templates/forbidden.html +++ b/packages/plugin-default-pages/templates/forbidden.html @@ -7,42 +7,7 @@ Forbidden - Origami - + @@ -51,7 +16,7 @@ -

You’re not permitted to see this.

+

You’re not permitted to see this.

The page you’re trying to access has restricted access. If you feel this is a mistake, contact your admin. diff --git a/packages/plugin-default-pages/templates/internal-error.html b/packages/plugin-default-pages/templates/internal-error.html index ff7074d..f8c9a22 100644 --- a/packages/plugin-default-pages/templates/internal-error.html +++ b/packages/plugin-default-pages/templates/internal-error.html @@ -7,42 +7,7 @@ Unknown Error - Origami - + @@ -51,10 +16,11 @@ -

Oops! Something went wrong

+

Oops! Something went wrong.

We're very sorry, however something went wrong when trying to load this page. - Please try again or contact support. +Please try again or
contact + support.

Return home diff --git a/packages/plugin-default-pages/templates/unauthorized.html b/packages/plugin-default-pages/templates/unauthorized.html new file mode 100644 index 0000000..54a309b --- /dev/null +++ b/packages/plugin-default-pages/templates/unauthorized.html @@ -0,0 +1,27 @@ + + + + + + + + Unauthorized - Origami + + + + + + + + +

No authorization found.

+

+ This page is not publicly available.
+ To access it please login first. +

+ Return home + + +