Interface: Authorization
Authorization related utils
Authentication
forgotPassword
forgotPassword:
ForgotPassword
Initialize forgot password procedure for email
Calls forgotPassword
methods on @aws-amplify/auth
module.
forgotPasswordSubmit
forgotPasswordSubmit:
ForgotPasswordSubmit
Submit new password for account
Calls forgotPasswordSubmit
method from Auth
module from @aws-amplify/auth
package.
getToken
getToken:
GetToken
If authorized, retrieves currentSession
from Auth
module from @aws-amplify/auth
package and retrieves idToken
from currentUser
object.
getUserData
getUserData:
GetUserData
Get current user's data or if not exists current session. Use this method to get information about currently logged in user. This is useful for reading current state of authentication or accessing current user details.
Usage
mimeeqAuth.authorization
.getUserData()
.then((user) => {
if (user) {
// logged in
console.log(user);
} else {
// logged out
}
})
.catch((err) => {
console.error(err);
});
resendSignUp
resendSignUp:
ResendSignUp
Resend SignUp confirmation email
Uses resendSignUp
from Auth
object from @aws-amplify/auth
signIn
signIn:
SignIn
Sign in to Mimeeq account
Uses signIn
from Auth
module from @aws-amplify/auth
package.
signOut
signOut:
SignOut
Sign out from Mimeeq
Uses signOut
from Auth
module from @aws-amplify/auth
package. Clears sessionStorage
Usage
mimeeqAuth.authorization.signOut().then(() => {
window.location.reload();
});