def create_session!
      # Skip authorizing if there was an error from the authorization.
      handle_token_error
      # Try to get a code (the rescue block will also prevent crazy crashes)
      access = @strategy.authenticate(@request.GET['code'])
      @request.session[:redd_session] = access.to_h
    rescue Errors::TokenRetrievalError, Errors::ResponseError => error
      @request.env['redd.error'] = error
    end
def create_session!
      # Skip authorizing if there was an error from the authorization.
      handle_token_error
      # Try to get a code (the rescue block will also prevent crazy crashes)
      access = @strategy.authenticate(@request.GET['code'])
      @request.session[:redd_session] = access.to_h
    rescue Errors::TokenRetrievalError, Errors::ResponseError => error
      @request.env['redd.error'] = error
    end
Store the access token and other details in the user's browser, assigning any errors to
 the 'redd.error' env variable.