Fix programmer error in login flow
This commit is contained in:
+3
-1
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user