rbCAS / CASino

CASino is a Ruby-based Single Sign-On solution supporting the CAS standard
MIT License
329 stars 189 forks source link

How can i access current_user in other controllers #122

Closed trkrameshkumar closed 9 years ago

trkrameshkumar commented 9 years ago

Hi @pencil The current_user helper method is only available on sessions controller , other than this session controller i cannot able to access the current_user helper method on any other controller.

calmyournerves commented 9 years ago

Hi Ramesh, could you give us some more details about what you are trying to accomplish?

trkrameshkumar commented 9 years ago

Hi Samuel Sieg (@calmyournerves)

I have 3 rails applications , one of them is a going to be central application for authentication which will be using CASino gem to do that, and other two are Client applications, I am trying to install casino gem in my existing central rails application instead of using your ready made CASino Server app, in that case how do i access to the current_user helper method across all the controlle to perform my operation based on current logged in user.

pencil commented 9 years ago

include CASino::SessionsHelper in your custom controller.

trkrameshkumar commented 9 years ago

Thanks @pencil

bakku commented 8 years ago

This did not work for me.

An alternative solution seems to be:

class CustomController < ApplicationController
  helper CASino::Engine.helpers

  # custom actions
end