Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cognito_login(username, password) {
- var authenticationData = {
- Username : username,
- Password : password
- };
- var authenticationDetails = new AWSCognito.CognitoIdentityServiceProvider.AuthenticationDetails(authenticationData);
- var userData = {
- Username : username,
- Pool : AWSC_userPool
- };
- var cognitoUser = new AWSCognito.CognitoIdentityServiceProvider.CognitoUser(userData);
- cognitoUser.authenticateUser(authenticationDetails, {
- onSuccess: function (result) {
- return true;
- },
- onFailure: function(err) {
- console.log(err);
- return false;
- }
- });
- }
- from flask_wtf import FlaskForm
- from wtforms.fields import TextField, BooleanField, PasswordField
- from wtforms.validators import DataRequired
- class LoginForm(FlaskForm):
- username = TextField('username', validators=[DataRequired()])
- password = PasswordField('password', validators=[DataRequired()])
- def validate(self):
- if not FlaskForm.validate(self):
- return False
- ... javascript here ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement