AuthService is used to retrieve all user-related data and authenticate the user. You can import the AuthService from the experro-storefront package.
AuthService provides.
isUserLoggedIn
This function returns eitherfalse or true to indicate whether the user is logged in or not.
getUserDetails
This function returns the user details including cart, store, and user information.setUserDetails
This function is used to update the details of the user. It takesuserDetails as the parameter.
login
This function is used to login to the base theme. The function accepts an object withusername and password as two properties.
logout
This function logs you out from the base theme.signup
This function is used to register the user details. This function accepts an object withfirstName, lastName, email, password, phone, company, and customFields as properties of the object.
forgotPassword
The function is used to reset the password. This function accepts an object withemail as the property of the object.