Module: AuthPage

Methods

(inner) AuthButton(props)

It returns a button with the text and action props.
Parameters:
Name Type Description
props object the props of the button (text, action)
Source:
Returns:
the button div with the props

(inner) AuthPage(props)

It creates the Sign up and Sign In Pages for the AREA It has a login with facebook on Sign In page
Parameters:
Name Type Description
props the props of the page (userInformation and allAreas)
Source:
Returns:
the page corresponding to the current authMode

(inner) CenterButton(props)

It returns a button with the text props.
Parameters:
Name Type Description
props string the props of the button (text)
Source:
Returns:
the button div with the props

(inner) changeAuthMode()

It changes the authMode between SignIn and SignUp
Source:

(inner) fetchWithTimeout(resource, optionsopt)

It fetches a resource, but if the fetch takes longer than the timeout, it aborts the fetch
Parameters:
Name Type Attributes Description
resource string The URL to fetch.
options * <optional>
An object containing any custom settings that you want to apply to the request.
Source:
Returns:
A function that takes two parameters, resource and options.

(inner) handleChange(event)

If the event target type is email, set the email state to the event target value. Otherwise, set the password state to the event target value
Parameters:
Name Type Description
event The event that triggered the function.
Source:

(inner) onLoginFacebook(event)

The function is called when the user clicks on the Facebook login button. It prevents the default action of the button, and then sets the persistence of the user to none. This means that the user will not be remembered by the browser. Then, the user is redirected to the Facebook login page
Parameters:
Name Type Description
event The event that triggered the function.
Source:

(inner) onSubmit(event)

The function is called when the user clicks the submit button. It prevents the default action of the submit button, which is to refresh the page. It then creates a requestOptions object, which contains the method, mode, headers, and body of the request. The body of the request is a JSON object containing the email and password of the user. The function then checks if the authMode is signup or login, and sends the request to the appropriate endpoint
Parameters:
Name Type Description
event the event that triggered the function
Source:

(inner) requestServer(endpoint, requestOptions)

It sends a request to the server, and if the server returns a userUid, it adds the user's information into the cache and navigates to the home page
Parameters:
Name Type Description
endpoint the endpoint of the server you want to request
requestOptions A request to the server.
Source:

(inner) signInPage()

It returns a form with an email input, a password input, a button to submit the form, and a link to change the authentication mode
Source:
Returns:
A form with a title, an email input, a password input, a button to submit the form, and a link to the sign up page.

(inner) signUpPage()

It returns a form with a logo, a title, three inputs, a button and a link to the login page
Source:
Returns:
A form with a logo, a title, 3 inputs, a button and a link to the login page.

(inner) updateIP(event)

It updates the IP address of the user in the state of the application
Parameters:
Name Type Description
event the event that triggered the function
Source: