discourse/discourse — pull request #1672 by shivpkumar (2013-11-19 05:12:24+00:00)
Title: Add 'session' to after_create_account method

If you're creating an authenticator as a plugin, it may be useful to have access to session data at some point during the authentication process. This could be during either the after_authenticate or after_create_account methods. I'm proposing the after_create_account method since I feel it makes more sense to create a new session after a new account is created. It doesn't matter either way, though. The idea is to have access to session data.

In our case, the way our current_user method works is by checking if a certain token exists within a session before each page load (we do not store the token in the database as our security team does not want us to do so). A few members of the Discourse team have access to our repo to take a look at how we'd use this: https://github.com/newrelic/forum/blob/new_user/plugins/golden_gate_client/plugin.rb

The only downside/risk to accepting this PR is that it would break any other implementations of custom authenticators. I imagine there aren't many of these currently, so this may be a good time to do this.