Add a comment for more public controllers (#553)
This commit is contained in:
parent
3bbfa03114
commit
9fa9a22d54
3 changed files with 8 additions and 4 deletions
|
|
@ -1,14 +1,15 @@
|
|||
class NotificationsController < ApplicationController
|
||||
# No authorization required for entirely public controller
|
||||
before_action :create_enricher
|
||||
|
||||
def index
|
||||
if user_signed_in?
|
||||
@notifications_index = true
|
||||
@user = if params[:username] && current_user.is_admin?
|
||||
User.find_by_username(params[:username])
|
||||
else
|
||||
current_user
|
||||
end
|
||||
User.find_by_username(params[:username])
|
||||
else
|
||||
current_user
|
||||
end
|
||||
@activities = cached_activities
|
||||
@last_user_reaction = @user.reactions.pluck(:id).last
|
||||
@last_user_comment = @user.comments.pluck(:id).last
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
# Don't need a policy for this since this is our sign up/in route
|
||||
include Devise::Controllers::Rememberable
|
||||
def self.provides_callback_for(provider)
|
||||
# raise env["omniauth.auth"].to_yaml
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
class RegistrationsController < Devise::RegistrationsController
|
||||
prepend_before_action :require_no_authentication, :only => []
|
||||
# No authorization required for public registration route
|
||||
|
||||
def new
|
||||
if user_signed_in?
|
||||
redirect_to "/dashboard?signed-in-already&t=#{Time.now.to_i}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue