synapse-react-client
Version:
[](https://travis-ci.com/Sage-Bionetworks/Synapse-React-Client) [](https://badge.fury.io/js/synaps
59 lines (58 loc) • 1.81 kB
TypeScript
import * as React from 'react';
export declare const PROVIDERS: {
GOOGLE: string;
};
declare type State = {
username: string;
password: string;
email: string;
isSignedIn: boolean;
hasLoginInFailed: boolean;
errorMessage: string;
};
declare type Props = {
ssoRedirectUrl?: string;
redirectUrl?: string;
sessionCallback: () => void;
};
/**
* Demo of user session, show login screen and handling user login submission.
*
* To support Google SSO in your portal, you must add your domain to the Authorized Redirect URIs
* for Synapse authentication.
* This can be done by contacting synapseInfo@sagebionetworks.org to form a collaboration.
* Synapse engineers must add your redirect URL in the Google API console found at https://console.cloud.google.com/ for this functionality to work.
*
* @class Login
* @extends {React.Component}
*/
declare class Login extends React.Component<Props, State> {
authenticationReceiptKey: string;
/**
* Creates a user session, maintaining credentials
* @param {*} props
* @memberof Login
*/
constructor(props: Props);
/**
* Updates internal state with the event that was triggered
*
* @param {*} event Form update
*/
handleChange(event: React.ChangeEvent<HTMLInputElement>): void;
/**
* Handle user login on click
*
* @param {*} clickEvent Userclick event
*/
handleLogin(clickEvent: React.FormEvent<HTMLElement>): Promise<void>;
/**
* Shows user login failure view on login failure
*
* @returns view to be displayed on user sign in error.
*/
getLoginFailureView(): JSX.Element | boolean;
onGoogleSignIn(event: React.MouseEvent<HTMLButtonElement>): void;
render(): JSX.Element;
}
export default Login;