adonisjs / ally

AdonisJS Social Authentication Provider
MIT License
159 stars 53 forks source link

[v4] Allow to dynamically add parameters to redirect URI #105

Closed maxgalbu closed 3 years ago

maxgalbu commented 3 years ago

Proposed changes

Allow to dynamically add parameters to providers' redirect URI. I've tested this with:

Types of changes

What types of changes does your code introduce?

Checklist

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kevin1193 commented 3 years ago

hello is this merged on the latest update?

maxgalbu commented 3 years ago

Nope, this has not been merged in adonisjs/ally v4. You can already do this in adonisjs/ally v5.

kevin1193 commented 3 years ago

How can I do this in v5? This doesnt work when I tried it.

Route.get('/google/redirect', async ({ ally }) => {
  return ally
    .use('google')
    .redirect((redirectRequest) => {
      redirectRequest
        .param('access_type', 'offline')
        .param('prompt', 'select_account')
    })
})
kevin1193 commented 3 years ago

How can I do this in v5? This doesnt work when I tried it.

Route.get('/google/redirect', async ({ ally }) => {
  return ally
    .use('google')
    .redirect((redirectRequest) => {
      redirectRequest
        .param('access_type', 'offline')
        .param('prompt', 'select_account')
    })
})

What I want is that when I pass a custom parameter here. I can catch it into the callback url. is it possible?

maxgalbu commented 3 years ago

I think you're better with posting a question to https://github.com/adonisjs/core/discussions