mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix: Email and username trimming and invitation validation (#58442)
* 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>
This commit is contained in:
@@ -220,7 +220,9 @@ export class UserProfileRow extends PureComponent<UserProfileRowProps, UserProfi
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({ value: event.target.value });
|
||||
this.setState({
|
||||
value: event.target.value,
|
||||
});
|
||||
};
|
||||
|
||||
onInputBlur = (event: React.FocusEvent<HTMLInputElement>, status?: LegacyInputStatus) => {
|
||||
@@ -228,7 +230,9 @@ export class UserProfileRow extends PureComponent<UserProfileRowProps, UserProfi
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({ value: event.target.value });
|
||||
this.setState({
|
||||
value: event.target.value,
|
||||
});
|
||||
};
|
||||
|
||||
focusInput = () => {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user