micro_auth 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,4 +1,8 @@
1
1
  Changelog:
2
+ 0.3.0:
3
+ - Added option to redirect to something other than root on login.
4
+ If you specify an `admin_path` in your routes, this will be used
5
+ as the default instead of `root_path`.
2
6
  0.2.0:
3
7
  - Changed logout behavior to be more logical: on logout users are now redirected to root
4
8
  path instead of back.
@@ -15,13 +15,15 @@ class MicroAuth::SessionsController < ApplicationController
15
15
  def destroy
16
16
  reset_session
17
17
  session[:admin] = false
18
+ session[:target] = nil
18
19
  redirect_to root_path, :notice => 'Logged out.'
19
20
  end
20
21
 
21
22
  private
22
23
 
23
24
  def root_or_back
24
- target = session[:target] || root_path
25
+ default_path = admin_path || root_path
26
+ target = session[:target] || default_path
25
27
  session[:target] = nil
26
28
  target
27
29
  end
@@ -1,3 +1,3 @@
1
1
  module MicroAuth
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-24 00:00:00.000000000Z
12
+ date: 2012-07-25 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70109050930000 !ruby/object:Gem::Requirement
16
+ requirement: &10094700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70109050930000
24
+ version_requirements: *10094700
25
25
  description: A super simple session-based authentication gem, for when you need to
26
26
  add basic admin capability to a single-user Rails app.
27
27
  email: andrew@eighty-b.com
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  requirements: []
62
62
  rubyforge_project:
63
- rubygems_version: 1.8.15
63
+ rubygems_version: 1.8.10
64
64
  signing_key:
65
65
  specification_version: 3
66
66
  summary: An absolutely tiny authentication gem for single-admin rails apps.