<commit_before>require 'uri'
require 'net/http'

class Api::UsersController < ApplicationController
  def authorize
    @user = User.find(slack_token: params[:token])

    if @user.nil?
      # make get request to https://slack.com/oauth/authorize
      # client_id: 14103637812.14111721303
      # scopes: user.read, user.write
      # redirect_uri: http://www.uber-slack-middleware.herokuapp.com/api/authorizations/create
      session[:session_token] = User.session_token
      User.new(slack_token: params[:token], slack_user_id: params[:user_id], session[:session_token])
      redirect_uri "https://login.uber.com/oauth/v2/authorize?response_type=code&client_id=B4K8XNeyIq4qsI0QqCN8INGv7Ztn1XIL"<commit_msg>review uber OAuth method<commit_after>require 'uri'
require 'net/http'

class Api::UsersController < ApplicationController
  def authorize
    # render nil if params[:token] != ENV[slack_token]
    @user = User.find_by(slack_user_id: params[:user_id])
    if @user.nil?
      session[:session_token] = User.session_token
      User.new(slack_user_id: params[:user_id], session[:session_token])
      redirect_to "https://login.uber.com/oauth/v2/authorize?response_type=code&client_id=B4K8XNeyIq4qsI0QqCN8INGv7Ztn1XIL"
{'fraction_non_alphanumeric': 0.11951219512195121, 'fraction_numerical': 0.030894308943089432, 'mean_word_length': 5.034313725490196, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, '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': '7574830', 'n_tokens_mistral': 451, 'n_tokens_neox': 435, 'n_words': 63}