Skip to content

Commit

Permalink
ensure that confirmation email fragment is placed BEFORE querystring …
Browse files Browse the repository at this point in the history
…for proper angularjs $location parsing. resolves lynndylanhurley/ng-token-auth#18.
  • Loading branch information
lynndylanhurley committed Aug 26, 2014
1 parent c301891 commit b367d67
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ GIT
PATH
remote: .
specs:
devise_token_auth (0.1.26)
devise_token_auth (0.1.27.beta1)
devise (~> 3.2.4)
rails (~> 4.1)

Expand Down
12 changes: 10 additions & 2 deletions app/models/devise_token_auth/concerns/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,18 @@ def extend_batch_buffer(token, client_id)
protected


# ensure that fragment comes AFTER querystring for proper $location
# parsing using AngularJS.
def generate_url(url, params = {})
uri = URI(url)
uri.query = params.to_query
uri.to_s

res = "#{uri.scheme}://#{uri.host}"
res += ":#{uri.port}" if (uri.port and uri.port != 80 and uri.port != 443)
res += "#{uri.path}" if uri.path
res += "##{uri.fragment}" if uri.fragment
res += "?#{params.to_query}"

return res
end


Expand Down
2 changes: 1 addition & 1 deletion lib/devise_token_auth/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module DeviseTokenAuth
VERSION = "0.1.26"
VERSION = "0.1.27.beta1"
end
Binary file modified test/dummy/app/assets/images/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b367d67

Please sign in to comment.