<commit_before>'use strict'

import queryString from 'query-string'
import { decodeToken } from 'jsontokens'
import { makeAuthRequest, verifyAuthResponse } from './authMessages'
import { updateQueryStringParameter } from '../index'

const BLOCKSTACK_HANDLER = "web+blockstack"
const BLOCKSTACK_STORAGE_LABEL = "blockstack"
const DEFAULT_BLOCKSTACK_HOST = "https://blockstack.org/auth"

/**
 * For applications
 */

export function isUserSignedIn() {
  return window.localStorage.getItem(BLOCKSTACK_STORAGE_LABEL) ? true : false
}

export function redirectUserToSignIn(authRequest,
                                     blockstackIDHost=DEFAULT_BLOCKSTACK_HOST) {
  setTimeout(function() {
    window.location = blockstackIDHost + "?authRequest=" + authRequest
  }, 500)

  window.location = BLOCKSTACK_HANDLER + ":" + authRequest<commit_msg>revert blockstack protocol handler<commit_after>'use strict'

import queryString from 'query-string'
import { decodeToken } from 'jsontokens'
import { makeAuthRequest, verifyAuthResponse } from './authMessages'
import { updateQueryStringParameter } from '../index'

const BLOCKSTACK_HANDLER = "blockstack"
const BLOCKSTACK_STORAGE_LABEL = "blockstack"
const DEFAULT_BLOCKSTACK_HOST = "https://blockstack.org/auth"

/**
 * For applications
 */

export function isUserSignedIn() {
  return window.localStorage.getItem(BLOCKSTACK_STORAGE_LABEL) ? true : false
}

export function redirectUserToSignIn(authRequest,
                                     blockstackIDHost=DEFAULT_BLOCKSTACK_HOST) {
  setTimeout(function() {
    window.location = blockstackIDHost + "?authRequest=" + authRequest
  }, 500)

  window.location = BLOCKSTACK_HANDLER + ":" + authRequest
{'fraction_non_alphanumeric': 0.09840895698291102, 'fraction_numerical': 0.0035356511490866236, 'mean_word_length': 4.66, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2191584', 'n_tokens_mistral': 504, 'n_tokens_neox': 495, 'n_words': 102}