question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I have an api that I have mounted on an url like this: http://localhost/v2/social/

My provider callbacks are configured like this: /v2/social/connect/twitter/done

The callbacks in between however, do not know about the /v2/social part. These callbacks will come back to http://localhost/connect/twitter/callback.

I tried setting the grant.server.host to localhost/v2/social, but this didn’t work. I dived a bit into the source code and added a quick fix to be able to specify path prefix options. I tried it with express and it seems to work.

Here is what I did: https://github.com/arjanfrans/grant/commit/b18df7033fa8756ef8e18dadc8bcc0c9df880df1

In the config I then have something like this:

{
  server: {
    protocol: 'http',
    host: 'localhost',
    transport: 'session',
    path: '/v2/social'
  },
  twitter: {
    key: 'keyhere',
    secret: 'secrethere'
    callback: '/connect/twitter/done'
  }
}

To me it seems like a missing feature. It would be nice to see it integrated. I could work on a proper pull request if I have some time next week.

Thoughts?

Thanks.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
simovcommented, Mar 18, 2016

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 👍

0reactions
simovcommented, Mar 27, 2016

Version 3.6.0 is published.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting the IMAP Path Prefix on your iPhone - InMotion Hosting
You can enter in the IMAP path prefix by going to Settings > Mail > Account > Advanced > IMAP Path Prefix. Enter...
Read more >
Adding a Path Prefix - Gatsby
Add the path prefix to paths using withPrefix​​ For pathnames you construct manually, there's a helper function, withPrefix that prepends your path prefix...
Read more >
What is My IMAP Path Prefix? | HostGator Support
The IMAP path's prefix is generally pre-configured on most third party mail clients and can be remedied by subscribing to the IMAP folders...
Read more >
Updating the IMAP path prefix in Mac Mail | Knowledge Base
How to update the IMAP path prefix in Mac Mail · STEP 1. Open Mac Mail · STEP 2. Choose 'Mail > Preferences'...
Read more >
POP vs IMAP - What's the difference? - xneelo Help Centre
The IMAP Path Prefix is a setting entered into your email software settings that tell the software that it should synchronise ALL of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found