This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# regex pattern for standard message | |
message_format='^\ABC-[0-9]{4}' | |
if ! grep -iqE "$message_format" "$1"; then | |
echo "Error: commit message should follow the pattern of ABC-1234 commit message" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi | |
DIRTY_SYNTAX="console\|debugger\|<<<<<<<|=======|>>>>>>>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
signUp(email, password) { | |
return new Promise((resolved, reject) => { | |
const userPool = new AWSCognito.CognitoUserPool(this._POOL_DATA); | |
let userAttribute = []; | |
userAttribute.push( | |
new AWSCognito.CognitoUserAttribute({ Name: "email", Value: email }) | |
); | |
userPool.signUp(email, password, userAttribute, null, function(err, result) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
confirmUser(verificationCode, userName) { | |
return new Promise((resolved, reject) => { | |
const userPool = new AWSCognito.CognitoUserPool(this._POOL_DATA); | |
const cognitoUser = new AWSCognito.CognitoUser({ | |
Username: userName, | |
Pool: userPool | |
}); | |
cognitoUser.confirmRegistration(verificationCode, true, function(err, result) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
authenticate(email, password) { | |
return new Promise((resolved, reject) => { | |
const userPool = new AWSCognito.CognitoUserPool(this._POOL_DATA); | |
const authDetails = new AWSCognito.AuthenticationDetails({ | |
Username: email, | |
Password: password | |
}); | |
const cognitoUser = new AWSCognito.CognitoUser({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-header> | |
<ion-navbar> | |
<ion-title> | |
Ionic cognito app - Sign in | |
</ion-title> | |
</ion-navbar> | |
</ion-header> | |
<ion-content padding> | |
<form (ngSubmit)="login()" #registerForm="ngForm"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from "@angular/core"; | |
import { CognitoServiceProvider } from "../../providers/cognito-service/cognito-service"; | |
import { SignUpPage } from "../../pages/sign-up/sign-up"; | |
@Component({ | |
selector: "page-login", | |
templateUrl: "login.html" | |
}) | |
export class LoginPage { | |
email: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-header> | |
<ion-navbar> | |
<ion-title> | |
Ionic cognito app - Sign up | |
</ion-title> | |
</ion-navbar> | |
</ion-header> | |
<ion-content class="login-content" padding> | |
<div class="login-box"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from "@angular/core"; | |
import { NavController, NavParams } from "ionic-angular"; | |
import { CognitoServiceProvider } from "../../providers/cognito-service/cognito-service"; | |
@Component({ | |
selector: "page-sign-up", | |
templateUrl: "sign-up.html" | |
}) | |
export class SignUpPage { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-header> | |
<ion-navbar> | |
<ion-title> | |
Ionic cognito app - Sign up | |
</ion-title> | |
</ion-navbar> | |
</ion-header> | |
<ion-content class="login-content" padding> | |
<div class="login-box"> |
OlderNewer