<commit_before># coding: utf-8
class ApiTokensController < ApplicationController
  TOKEN_TTL = 1.hour

  def show
    unless CatarseSettings[:api_host].present? && CatarseSettings[:jwt_secret].present?
      return render json: {error: "you need to have api_host and jwt_secret configured to get an API token"}, status: 500
    end

    unless current_user.present?<commit_msg>use user_signed_in? helper from devise and warden to avoid cache when user logout<commit_after># coding: utf-8
class ApiTokensController < ApplicationController
  TOKEN_TTL = 1.hour

  def show
    unless CatarseSettings[:api_host].present? && CatarseSettings[:jwt_secret].present?
      return render json: {error: "you need to have api_host and jwt_secret configured to get an API token"}, status: 500
    end

    unless user_signed_in?
{'fraction_non_alphanumeric': 0.07598039215686274, 'fraction_numerical': 0.012254901960784314, 'mean_word_length': 4.673611111111111, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6633016', 'n_tokens_mistral': 247, 'n_tokens_neox': 235, 'n_words': 81}