Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom CSS styling of login page #111

Merged
merged 3 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- New auth option `cssUrl` which is then loaded as a stylesheet in the chaperone html. This only works with a custom chaperone build.


## [0.6.15-prerelease] - 2023-09-06

Expand Down
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class WebSdkApi implements AppAgentClient {
if (authOpts.logoUrl !== undefined) {
url.searchParams.set('logo_url', makeUrlAbsolute(authOpts.logoUrl))
}
if (authOpts.cssUrl !== undefined) {
url.searchParams.set('css_url', makeUrlAbsolute(authOpts.cssUrl))
}
if (authOpts.appName !== undefined) {
url.searchParams.set('app_name', authOpts.appName)
}
Expand Down Expand Up @@ -268,6 +271,8 @@ type AuthFormCustomization = {
appName?: string
// The URL of the hApp logo. Currently displayed on a white background with no `width` or `height` constraints.
logoUrl?: string
// The URL of a CSS file to apply to the Holo Login iframe
cssUrl?: string
// Determines whether the "REGISTRATION CODE" field is shown.
//
// Set this to `true` if you want to prompt the user for a registration code that will be passed directly to your happ as a mem_proof (ie, not using a memproof server). This field does nothing if the membraneProofServer option (see below) is set.
Expand All @@ -289,6 +294,8 @@ type AuthFormCustomization = {
// An arbitrary value that will be passed to the Membrane Proof Server as additional information
payload: unknown
},
// The parent HTMLElement to insert the login iframe into. Defaults to `document.body`
container?: HTMLElement,
// INTERNAL OPTION
// anonymous_allowed is barely implemented in Chaperone, and is subject to change,
// so exposing this in the documentation is misleading.
Expand Down
Loading