The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
598 B

  1. class HomeController < ApplicationController
  2. before_action :authenticate_user!
  3. def index
  4. @body_classes = 'app-body'
  5. @home = Feed.new(:home, current_user.account).get(20)
  6. @mentions = Feed.new(:mentions, current_user.account).get(20)
  7. @token = find_or_create_access_token.token
  8. end
  9. private
  10. def find_or_create_access_token
  11. Doorkeeper::AccessToken.find_or_create_for(Doorkeeper::Application.where(superapp: true).first, current_user.id, nil, Doorkeeper.configuration.access_token_expires_in, Doorkeeper.configuration.refresh_token_enabled?)
  12. end
  13. end