mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 13:39:19 -06:00
121631daae
* fix: email and username trimming and invitation validation * Trim leading and trailing whitespaces from email and username on signup * Check whether the provided email address is the same as where the invitation sent * Align tests Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
13 lines
509 B
TypeScript
13 lines
509 B
TypeScript
import { config } from '@grafana/runtime/src';
|
|
|
|
// https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address
|
|
export const w3cStandardEmailValidator =
|
|
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
|
|
export function isTrial() {
|
|
const expiry = config.licenseInfo?.trialExpiry;
|
|
return !!(expiry && expiry > 0);
|
|
}
|
|
|
|
export const highlightTrial = () => isTrial() && config.featureToggles.featureHighlights;
|