lynndylanhurley / lynndylanhurley/devise_token_auth

Enhancement suggestion of build_auth_url

Open
#1,202 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Ruby
Stars
3.6k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I just found after few hours of struggle that the `redirect_url` needs to be a full URL such as `http://mydomain.com/my_path/confirmed` because it is parsed in url.rb ([DeviseTokenAuth::Url.generate](https://github.com/lynndylanhurley/devise_token_auth/blob/72976d8d3a0cd8f24578138f9edb7e7930fb75b2/lib/devise_token_auth/url.rb#L5))

Initially, I was trying something like that which seems more natural for me : `my_path/confirmed`

Would it be useful to check if the `base_url` is a path or a full url before constructing the URL ?

If it's a full URL, nothing change, otherwise lines [8](https://github.com/lynndylanhurley/devise_token_auth/blob/72976d8d3a0cd8f24578138f9edb7e7930fb75b2/lib/devise_token_auth/url.rb#L8) and [9](https://github.com/lynndylanhurley/devise_token_auth/blob/72976d8d3a0cd8f24578138f9edb7e7930fb75b2/lib/devise_token_auth/url.rb#L9) are optionals.

Contributor guide

Open the contributing guide

Research direction

Start in lib/devise_token_auth/url.rb, especially DeviseTokenAuth::Url.generate and the referenced lines 8-9. Check how redirect_url is assembled, then define the path-versus-full-URL behavior so full URLs remain unchanged and relative paths are accepted; done means both forms construct the expected URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
api, authentication
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.