if @user.persisted?
      sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated
      set_flash_message(:notice, :success, :kind => "Bitbucket") if is_navigational_format?
    else
      session["devise.bitbucket_data"] = request.env["omniauth.auth"]