dwyl / dwyl/auth

Keep state query parameters when redirecting to "main" application

Open
#72 1 comment 1 reaction 0 assignees View on GitHub
enhancement question
Dominant language
Elixir
Stars
141
Forks
8
PR merge metrics
No merged PRs in 30d

Description

The following code adds the jwt to the referrer value (ie the "main" application url):
https://github.com/dwyl/auth/blob/9744fe50c697b613749f07c55b10bcb19744e83d/lib/auth_web/controllers/auth_controller.ex#L384-L385

However it will remove all existing query parameters and replace them with only the jwt:

```elixir
jwt = "fake_jwt"
state = "http://localhost:4000/admin?name=bob"
List.first(String.split(URI.decode(state), "?")) <> "?jwt=" <> jwt
# returns http://localhost:4000/admin?jwt=fake_jwt
```

Would it be better to concatenate the jwt to the exsting query parameter or is it intentional to only keep jwt

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.