Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the ability to change the refresh API path completely, and instead, allow the users to give a prefix to the API #65

Closed
22 tasks done
rishabhpoddar opened this issue Oct 12, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@rishabhpoddar
Copy link
Member

rishabhpoddar commented Oct 12, 2020

The refresh API will always be {some-prefix}/session/refresh. The prefix can be defined by the user. This will make it easier for users to use login + sessions using us.

  • We will need to remove the relevant config params, and take a new param called the apiBasePath. The default value of this will be /auth. However the user can override it by providing:
    • a full URL: https://example.com/custom-base/ => /custom-base
    • a path: /custom-base/ => /custom-base
    • empty path: / => "" OR "" => ""
    • The above can be provided with or without a leading and or trailing slash:
      • custom/base => /custom/base
      • custom/base/. => /custom/base
      • /custom/base => /custom/base
      • custom/base/ => /custom/base
      • custom/base/ => /custom/base
      • custom-base => /custom-base
      • If there are a domain, or protocol, or query or # or anything else, remove them.
  • On the frontend SDKs, users will also need to provide their API domain, which they can provide via a variable apiDomain. This is a compulsory value. It can be of the form:
    • example.com => https://example.com
    • example.com/ => https://example.com
    • http://example.com => http://example.com
    • https://example.com/ => https://example.com`
    • localhosthttp://localhost
    • IP Addresshttp://IP Address
    • If there is a path or query or #, remove them

Therefore, on the frontend, the refresh endpoint will be: ${apiDomain}${apiBasePath}/session/refresh
On the backend, the API will listen for the path ${apiBasePath}/session/refresh

Tasks

  • nodejs
    • change
    • testing
  • supertokens-website
    • change
    • testing
  • Migration guide
    • supertokens-website
    • nodejs
  • Documentation change
    • supertokens-website
    • nodejs
  • Create an issue on other SDKs about this
    • flask
    • javalin
    • golang
    • laravel
    • fastapi
  • Create an issue on other frontend SDKs
    • react-native
    • android
    • ios
@rishabhpoddar rishabhpoddar added this to To do in login (v3.0.X) Oct 12, 2020
@rishabhpoddar rishabhpoddar added the enhancement New feature or request label Oct 12, 2020
@rishabhpoddar rishabhpoddar moved this from To do to Misc Todo in login (v3.0.X) Oct 14, 2020
@rishabhpoddar rishabhpoddar moved this from General Todo to In progress in login (v3.0.X) Oct 19, 2020
@rishabhpoddar rishabhpoddar self-assigned this Oct 19, 2020
@rishabhpoddar
Copy link
Member Author

rishabhpoddar commented Oct 21, 2020

@NkxxkN I have implemented functions for normalising paths and domains in a very extensive way with many tests (as per the above spec). Please use those functions & tests, otherwise please make sure to test your functions in a very similar manner (if not better).

I prefer if the exact same function is used in all places for this, so if you want to keep yours, I can have a look at the them, and then change the one in the supertokens-website.

rishabhpoddar added a commit to supertokens/supertokens-website that referenced this issue Oct 21, 2020
* implements functions for normalsing domains and paths as per supertokens/supertokens-core#65

* updates FDI version

* gets all tests to pass
@rishabhpoddar
Copy link
Member Author

@NkxxkN please feel free to review the two functions above, and think of other tests I may have missed

rishabhpoddar added a commit to supertokens/supertokens-node that referenced this issue Oct 21, 2020
rishabhpoddar added a commit to supertokens/supertokens-node that referenced this issue Oct 21, 2020
* changes as per issue supertokens/supertokens-core#65

* gets all tests to pass

* adds config tests
@rishabhpoddar rishabhpoddar moved this from In progress to Done in login (v3.0.X) Oct 21, 2020
@rishabhpoddar rishabhpoddar reopened this Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

1 participant