Comments (6)
I think it should work out of the box if you set your host
property to localhost/v2/social
and mount Grant with that prefix:
app.use('/v2/social', grant)
But I don't like using the host
property like that, also I haven't tested it myself so it might not work. Either way I'll figure out the best way to add this feature these days. I'm also going to add a new example and I'll probably update the docs as well.
Thanks for contributing 👍
from grant.
I didn't mount grant directly on the app, but have a wrapper around it with some custom middleware added.
My server runs multiple express apps which are routed by Nginx, so express doesn't really know about the path.
For example, this is how we proxy in Nginx:
/v2/social
-> express app A/v2/api
-> express app B
For this use case, it didn't work.
from grant.
Got it, that makes sense. I have NginX running on my workstation. It will take me some time to prepare everything but eventually this feature will be added one way or another. Just FYI the next release will be out by the end of this month.
from grant.
@arjanfrans take a look at the Path Prefix section.
In your case you just have to:
- Mount Grant as usual (without prefix).
- Set the path prefix using the
path
configuration option under theserver
key (this option is used only for generating theredirect_uri
that you specify for your OAuth app). - Prefix all your provider's
callback
configuration paths explicitly.
The reason why I'm not prefixing the callback paths automatically is because they are part of your own application. In other words the callback paths are not part of the Grant middleware, so the user shouldn't be forced to use the prefix there.
You can pull master and test if you want, in this case use the Alternative Require to require your fork.
Let me know what do you think.
from grant.
Looks good, I just tried it and it works. I agree on the automatic prefix on the callbacks, it is more flexible this way.
Thanks!
from grant.
Version 3.6.0 is published.
from grant.
Related Issues (20)
- Intended method of accessing session.grant HOT 2
- Discord Profile route always 401 Unauthorized HOT 7
- Recommended approach for handling config without checking into git HOT 1
- Support Deno? HOT 3
- iFrame redirect issue with Shopify oAuth HOT 4
- OAuth 2 state - how can I associate a successful grant with a user id HOT 5
- Is there a framework-agnostic API? HOT 1
- Telegram Oauth HOT 2
- Export the grant config and Options HOT 4
- Not working with Next 13 App Router
- How to use dynamic params in custom_params of grant? HOT 1
- Autodesk deprecated v1 (lib's current) oauth endpoints HOT 4
- Incorrect inclusion of client_secret for authorization_code grant in OAuth2 implementation HOT 1
- Switch to OAuth 2 for OpenStreetMap provider HOT 1
- Itch.io authentication HOT 2
- Alternating Domains HOT 5
- Allow to customize "missing provider" error URL? HOT 3
- Any Help to Implement Grant in Next JS
- Is it possible to pass arbitrary data in? HOT 1
- Grant playground open-source? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grant.