Skip to Content
Auth for your appYour sign-in page

Your sign-in page

Your users sign in on Foir’s hosted sign-in page. You decide what surrounds the form: a layout, a colour, images or a video beside it or behind it, and headings, text, screenshots and videos for each state the page can open in. The form is always Foir’s. It works the same on every page, in every sign-up mode, the waitlist included, so nothing you set can stop someone signing in.

A project that sets nothing gets the page Foir has always shown: a centred column with your name and logo above the form.

Where you edit it

In the console, open Access, Sign-in and choose the Page tab. The editor shows every field of the page with a live preview beside it. Switch the preview between the six entry states, a wide screen and a phone, light and dark, and each of your locales. Save draft keeps your changes as a draft. They reach the sign-in once you release them, with the rest of your drafts.

Editing a page needs the loginpages:write permission, and reading one needs loginpages:read. Managing the project gives both. A role in an organisation can give them too, so the people who look after one organisation can edit its page without reaching the rest of the project. A key used by CI can hold them, to push a config’s pages.

Layouts

A page has one of three layouts.

LayoutOn a wide screenOn a phone
CentredThe form in a column in the middle of the page.The same column.
SplitA panel beside the form, on the left or the right, taking half the width or two fifths.The panel becomes a band above the form, or is hidden.
Full-bleedA background filling the page, with the form on a card in the middle, on the left or on the right.The card fills the width, over the background.

The split panel and the full-bleed background are the page’s media: a colour, plus one image, a slideshow or one video. The colour shows when there is no image or video, and while one loads. A full-bleed background sits under a scrim, soft, medium or strong, so the card stands out from any image or video. A slideshow crossfades from image to image. It moves on by itself only for people who have not asked their device for reduced motion, and it can always be paused. A video behind the form plays on a loop, muted, on the same terms (see Videos).

Content

Content is an ordered list of headings, text, images, galleries and videos.

Each item sits beside the form or over the media. Content over the media sits on a dark scrim, so white text over it stays readable whatever the image. On a phone, where the media is a band or hidden, content over it moves into the column beside the form.

Each item also names the entry states it shows in, or shows in all of them.

StateWhen the page shows it
Sign inEvery visitor arrives here first. The form is always the front.
Sign upSomebody new joins, where your project lets anyone sign up.
WaitlistSomebody new asks to join, and your project takes sign-ups on a waitlist.
On the waitlistSomeone has just joined the waitlist.
Invitation onlySomebody new asks to join, and only invited people may.
ClosedSomebody new asks to join, and sign-ups are closed.

The first heading that shows in a state takes the place of Foir’s own heading for it. A waitlist page can say “Join the Rota beta” where Foir would say “Join the waitlist”, and show a gallery of screenshots of the app people are waiting for.

Text is prose, as in a record’s prose field. A quote and a line of attribution under it are two passages, and each passage can name one of your typography tokens. Links in text must be https: or mailto: addresses.

Every heading, line of text, alt text and caption is written per locale, in the locales your project serves. The page shows the copy in the visitor’s language when you have written it, and in your default locale when you have not.

Colours, font and corner radius

The page’s colours are your design tokens, never colour values: a token for light mode and one for dark, where dark falls back to light when you leave it out. The font and the corner radius are tokens too. That way the sign-in page matches what an app built on the same tokens shows, and changing a token changes every page that names it. See Design tokens.

The form stays readable on any page colour. On a light colour it takes Foir’s light look and on a dark colour its dark look, whichever theme the visitor has chosen, so a page that names only a light colour still reads in dark mode. Text that would fall below WCAG AA contrast on your colour is drawn in a colour that meets it, black or white where nothing else does. Buttons filled with your brand colour get the same check.

A release that would take a token out of force while a released page still names it is refused, and the refusal names the page and the token. Change the page first, or release the two together.

Images

An image is either a file from your project or an address.

A fileAn address
What it isOne of your project’s own images, or one of the level the page belongs to. It must be public, because the sign-in page is seen before anyone signs in.An https:// address.
How it is servedIn sized versions, so each screen loads the width it needs.Exactly as given. Foir never fetches it, so it is your server that the visitor’s browser asks.
In the editorChoose a file, or upload a new one in place: it is stored as a public file at the level you are editing.Use an address.

Every image needs alt text in your default locale, for people who cannot see it. Each use of an image has its own focal point and crop, so the same file can be framed differently in two places. The focal point stays in view at every width when the image fills a split panel or a full-bleed background. Click the image’s thumbnail in the editor to set it.

Videos

A video can fill the split panel or the full-bleed background, or sit in your content. Like an image, it is a file from your project or an address, and it must be an MP4 or WebM video, the two formats every browser plays.

A fileAn address
What it isOne of your project’s own videos, or one of the level the page belongs to. It must be public.An https:// address of an MP4 or WebM video.
How it is servedAs stored, with a poster Foir makes from it once it has been processed.Exactly as given. Foir never fetches it, so it cannot check the address plays: a video that cannot play falls back to its poster, or the colour.
In the editorChoose a file, or upload a new one in place: it is stored as a public file at the level you are editing.Use an address.

A video plays one of two ways.

How it playsWhere
On a loopBy itself, muted, over and over, with a button to pause it. It never has sound.Behind the form, or in the content.
With controlsWhen the visitor presses play, with the browser’s controls and its sound. It never plays by itself, and loads only enough to start.In the content.

A video on a loop waits on its poster for visitors who have asked their device for reduced motion, or their browser to save data, and none of it is downloaded until they press play. On a phone where the split panel is hidden, its video is never loaded.

The poster is the still shown before a video plays, and in its place if it cannot play. A file shows the poster Foir makes from it. Choose a poster of your own to replace it, or to give a video at an address one: without a poster, the media colour shows until the video plays.

Every video needs alt text in your default locale, saying what it shows. A video has no crop, only a focal point, which you set by clicking its poster in the editor. A video behind the form plays on every visit to your sign-in, so keep it short and small.

How a page is put together

A sign-in page belongs to a level: your project, or one organisation in it. An app can have a page of its own too. When someone signs in, each field of the page (the layout, the media, the content, the page colour, the font and the corner radius) is taken from the first of these that sets it:

  1. the page of the app they are signing in through;
  2. the page of the organisation they are signing in to, then of each organisation above it, nearest first;
  3. your project’s page;
  4. Foir’s default, the centred page.

A list is taken whole. If an organisation sets its own content, its list replaces the project’s, and items are never merged from two levels.

For example, the project Acme Rota sets a split layout, its brand colours and a welcome heading. Its organisation Northwind sets its own content, a heading for its members. Leeds, an organisation under Northwind, sets only the media colour. Someone signing in to Leeds sees the project’s split layout with Leeds’s media colour and Northwind’s heading. In the editor, each field says whether it is set here, and where it comes from when it is not.

An app’s page sits on top of the levels, field by field. An app that serves the whole project lays its page over every organisation signing in through it. Apps belong to the project, so an app’s page is edited at the project; an organisation that wants a look of its own sets its own page, or gets an app of its own.

Your terms and privacy pages are presentation fields, beside your name and logo, in Settings, General. Every sign-in page links to them under the form. An organisation can set its own, and inherits each one it leaves blank from the nearest level above that sets it. With neither set anywhere, the page shows no links.

In foir.config.ts

A page in config holds what the level sets and nothing else. The top-level loginPage is the project’s page, and an app’s own page goes on its authClients entry. A config belongs to the project, so an organisation keeps its page in code with foir login-page instead (see below).

import { defineConfig } from '@foir/cli/configs'; export default defineConfig({ key: 'rota', name: 'Rota', loginPage: { layout: { split: { side: 'right', width: 'fortySixty', onPhones: 'band' } }, pageColour: { light: 'color.surface', dark: 'color.surface.night' }, media: { colour: { light: 'color.brand' }, image: { url: 'https://images.rota.example/board.jpg', alt: { en: 'The rota board on a Monday' }, focalPoint: { x: 0.4, y: 0.3 }, }, }, content: [ { heading: { en: 'Join the Rota beta' }, states: ['waitlist'] }, { video: { url: 'https://videos.rota.example/swap-a-shift.mp4', alt: { en: 'Swapping a shift in two taps' }, poster: { url: 'https://images.rota.example/swap-a-shift.jpg' }, playback: 'controls', }, states: ['waitlist'], }, { text: { en: [ { kind: 'quote', text: 'It sorted our rota in a week.' }, { kind: 'paragraph', token: 'caption', text: 'Sam, Leeds' }, ], }, region: 'overMedia', }, ], }, authClients: [ { clientId: 'rota-kiosk', name: 'Kiosk', redirectUris: ['https://kiosk.rota.example/callback'], loginPage: { layout: { fullBleed: { card: 'centre', scrim: 'strong' } } }, }, ], });

Text in a config is one of three forms, per locale: a string for one paragraph, a list of passages (each a kind, an optional typography token, and its text), or the prose flow itself for marks, links and lists. foir pull writes each page back in the simplest form that says exactly what is stored, so pulling a project and pushing the file again changes nothing.

A push writes a page only when it differs from the draft. If someone has edited the page in the console since your config last pushed it, the push is refused and names the page: pull first to take their edits into your file, or push with --force to replace them. The full shape is in the config reference.

An organisation’s page in code

foir login-page reads and writes the page of the level you stand in: the project’s, or an organisation’s when you pass --org-id or after foir context switch-org. It is how an organisation’s page lives in source control, as its design tokens do with foir design-tokens. The file holds the page in the same form as a config’s loginPage.

# Write Northwind's page to a file foir login-page get --org-id org_northwind --out northwind-page.json # Save the file as Northwind's draft, then release it there foir login-page apply northwind-page.json --org-id org_northwind foir release publish login_page:login_page --org-id org_northwind

Applying the file get wrote changes nothing. With --app <clientId>, both commands work on an app’s own page at the project.

When to build your own sign-in page

The hosted page puts your content around Foir’s form and never runs your code: no HTML, script or stylesheet of yours is ever served on it. That keeps every project’s sign-in safe on the shared sign-in host. If you need a sign-in that looks and behaves entirely your own, build it in your app on the public API, with the sign-in calls in User Authentication.

Last updated on