dailycred 0.1.33 → 0.1.34
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/app/controllers/sessions_controller.rb +1 -1
- data/dailycred.gemspec +1 -1
- data/docs/lib/dailycred/helper.html +7 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -111,5 +111,5 @@ To specify where users should be redirected after authentication actions, setup
|
|
111
111
|
4. Push to the branch (`git push origin my-new-feature`)
|
112
112
|
5. Create new Pull Request
|
113
113
|
|
114
|
-
![](https://www.dailycred.com/dc.gif?client_id=dailycred "")
|
114
|
+
![](https://www.dailycred.com/dc.gif?client_id=dailycred&title=rails_repo "dailycred")
|
115
115
|
|
data/dailycred.gemspec
CHANGED
@@ -60,7 +60,7 @@ example:
|
|
60
60
|
</td>
|
61
61
|
<td class=code>
|
62
62
|
<div class='highlight'><pre> <span class="k">def</span> <span class="nf">authenticate</span>
|
63
|
-
<span class="n">
|
63
|
+
<span class="n">redirect_to_unauth</span> <span class="k">unless</span> <span class="n">current_user</span>
|
64
64
|
<span class="k">end</span></pre></div>
|
65
65
|
</td>
|
66
66
|
</tr>
|
@@ -106,6 +106,12 @@ make sure we have the correct state passed back and forth</p>
|
|
106
106
|
<span class="n">redirect_to</span> <span class="n">path</span><span class="p">,</span> <span class="n">opts</span>
|
107
107
|
<span class="k">end</span>
|
108
108
|
|
109
|
+
<span class="k">def</span> <span class="nf">redirect_to_unauth</span> <span class="n">opts</span> <span class="o">=</span> <span class="p">{}</span>
|
110
|
+
<span class="n">conf</span> <span class="o">=</span> <span class="no">Rails</span><span class="o">.</span><span class="n">configuration</span><span class="o">.</span><span class="n">DAILYCRED_OPTIONS</span>
|
111
|
+
<span class="n">path</span> <span class="o">=</span> <span class="o">!</span><span class="n">conf</span><span class="o">[</span><span class="ss">:after_unauth</span><span class="o">].</span><span class="n">nil?</span> <span class="p">?</span> <span class="n">conf</span><span class="o">[</span><span class="ss">:after_unauth</span><span class="o">]</span> <span class="p">:</span> <span class="n">dailycred_engine</span><span class="o">.</span><span class="n">auth_info_path</span>
|
112
|
+
<span class="n">redirect_to</span> <span class="n">path</span><span class="p">,</span> <span class="n">opts</span>
|
113
|
+
<span class="k">end</span>
|
114
|
+
|
109
115
|
|
110
116
|
<span class="no">ActiveSupport</span><span class="o">.</span><span class="n">on_load</span><span class="p">(</span><span class="ss">:action_controller</span><span class="p">)</span> <span class="k">do</span>
|
111
117
|
<span class="n">helper_method</span> <span class="ss">:current_user</span><span class="p">,</span> <span class="ss">:login_path</span><span class="p">,</span> <span class="ss">:set_state</span><span class="p">,</span> <span class="ss">:dailycred</span><span class="p">,</span> <span class="ss">:authenticate</span>
|