<commit_before>import auth from './auth';
import {
  LOGGED_IN_FLAG_KEY,
  AUTH_CLIENT_ID,
  AUTH_LOGOUT_COMPLETE_URL,
  LOGIN_REDIRECT_KEY,
  LOGOUT_REDIRECT_KEY,
  NON_STAFF_CONNECTION,
} from '../constants';

export const clearFlag = () => {
  localStorage.removeItem(LOGGED_IN_FLAG_KEY);
};

export const setFlag = () => {
  localStorage.setItem(LOGGED_IN_FLAG_KEY, true);
};

export const logIn = () => {
  localStorage.setItem(LOGIN_REDIRECT_KEY, window.location.href);
  auth.authorize({ initial_screen: 'login' });
};

export const logOut = () => {
  localStorage.setItem(LOGOUT_REDIRECT_KEY, window.location.href);
  auth.logout({
    clientID: AUTH_CLIENT_ID,
    returnTo: AUTH_LOGOUT_COMPLETE_URL,
  });
};

export const isLoggedIn = () =>
  localStorage.getItem(LOGGED_IN_FLAG_KEY) === 'true';

export const register = () => {
  localStorage.setItem(LOGIN_REDIRECT_KEY, window.location.href);
  auth.authorize({ initial_screen: 'signUp' });
};

export const resetPassword = (email, cb) => {
  auth.changePassword({ email, connection: NON_STAFF_CONNECTION }, cb);
};

export const redirectAfterLogIn = () => {
  const url = localStorage.getItem(LOGIN_REDIRECT_KEY) || '/account';
  setTimeout(() => {
    window.location.href = url;
  }, 1000);
};

export const redirectAfterLogOut = () => {
  const url = localStorage.getItem(LOGOUT_REDIRECT_KEY) || '/account';
  setTimeout(() => {
    window.location.href = url;
  }, 1000);
};
<commit_msg>increase delay<commit_after>import auth from './auth';
import {
  LOGGED_IN_FLAG_KEY,
  AUTH_CLIENT_ID,
  AUTH_LOGOUT_COMPLETE_URL,
  LOGIN_REDIRECT_KEY,
  LOGOUT_REDIRECT_KEY,
  NON_STAFF_CONNECTION,
} from '../constants';

export const clearFlag = () => {
  localStorage.removeItem(LOGGED_IN_FLAG_KEY);
};

export const setFlag = () => {
  localStorage.setItem(LOGGED_IN_FLAG_KEY, true);
};

export const logIn = () => {
  localStorage.setItem(LOGIN_REDIRECT_KEY, window.location.href);
  auth.authorize({ initial_screen: 'login' });
};

export const logOut = () => {
  localStorage.setItem(LOGOUT_REDIRECT_KEY, window.location.href);
  auth.logout({
    clientID: AUTH_CLIENT_ID,
    returnTo: AUTH_LOGOUT_COMPLETE_URL,
  });
};

export const isLoggedIn = () =>
  localStorage.getItem(LOGGED_IN_FLAG_KEY) === 'true';

export const register = () => {
  localStorage.setItem(LOGIN_REDIRECT_KEY, window.location.href);
  auth.authorize({ initial_screen: 'signUp' });
};

export const resetPassword = (email, cb) => {
  auth.changePassword({ email, connection: NON_STAFF_CONNECTION }, cb);
};

export const redirectAfterLogIn = () => {
  const url = localStorage.getItem(LOGIN_REDIRECT_KEY) || '/account';
  setTimeout(() => {
    window.location.href = url;
  }, 1800);
};

export const redirectAfterLogOut = () => {
  const url = localStorage.getItem(LOGOUT_REDIRECT_KEY) || '/account';
  setTimeout(() => {
    window.location.href = url;
  }, 1800);
};

{'fraction_non_alphanumeric': 0.14840261078667125, 'fraction_numerical': 0.005496392992098935, 'mean_word_length': 4.894736842105263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3514918', 'n_tokens_mistral': 1026, 'n_tokens_neox': 1034, 'n_words': 171}