Fix programmer error in login flow

This commit is contained in:
Andrew Miner
2015-05-11 12:08:59 -07:00
parent 8c54231d52
commit 64274810d7
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -24,8 +24,10 @@ fi
if [[ "$TARGET" == "staging" ]]; then if [[ "$TARGET" == "staging" ]]; then
TARGET_DIR="s3://new.$SITE/" TARGET_DIR="s3://new.$SITE/"
BUILD_CMD="build"
elif [[ "$TARGET" == "production" ]]; then elif [[ "$TARGET" == "production" ]]; then
TARGET_DIR="s3://$SITE/" TARGET_DIR="s3://$SITE/"
BUILD_CMD="dist"
fi fi
S3CMD_CFG="$HOME/.s3cfg" S3CMD_CFG="$HOME/.s3cfg"
@@ -35,7 +37,7 @@ if [[ ! -e "$S3CMD_CFG" ]]; then
cat $AWS_CONFIG_FILE | grep "aws_secret_access_key" | sed "s/aws_secret_access_key/secret_key/" >> "$S3CMD_CFG" cat $AWS_CONFIG_FILE | grep "aws_secret_access_key" | sed "s/aws_secret_access_key/secret_key/" >> "$S3CMD_CFG"
fi fi
if grunt clean dist; then if grunt clean $BUILD_CMD; then
echo "Preparing to upload to S3..." echo "Preparing to upload to S3..."
s3cmd sync -r --add-header="cache-control:max-age=1800" $SOURCE_DIR $TARGET_DIR s3cmd sync -r --add-header="cache-control:max-age=1800" $SOURCE_DIR $TARGET_DIR
echo "S3 Upload Complete" echo "S3 Upload Complete"
@@ -73,12 +73,12 @@ module.exports = class LoginPageController extends PageController
if (not @user?) and (@params?.state is @loginSecurityToken) if (not @user?) and (@params?.state is @loginSecurityToken)
@client.completeGitHubLogin code:@params.code @client.completeGitHubLogin code:@params.code
.then (response)-> .then (response)=>
attributes = response.json.data.user attributes = response.json.data.user
if attributes? if attributes?
router.user = new User attributes router.user = new User attributes
router.resumeAfterLogin() router.resumeAfterLogin()
.catch (error)-> .catch (error)=>
logger.error "Failed to get access token: #{error}" logger.error "Failed to get access token: #{error}"
@_accessTokenLookupFailed = true @_accessTokenLookupFailed = true
@refresh() @refresh()