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

Support relative callback and request paths in strategies #114

Open
hugomatinho opened this issue Jan 22, 2020 · 0 comments
Open

Support relative callback and request paths in strategies #114

hugomatinho opened this issue Jan 22, 2020 · 0 comments

Comments

@hugomatinho
Copy link

hugomatinho commented Jan 22, 2020

When dynamically changing the base_path callback and request paths are absolute thus disabling the dynamic nature of the call.

I'd like to propose that the strategies' callback_path and request_path be relative to the base_path

for example when using gettext and ueberauth, gettext changes the base path to /:locale even adding to the ueberauth base_path doesn't help as the strategy paths are absolute. defeating in this case the localization intent

config :ueberauth, Ueberauth,
  providers: [
    facebook: { Ueberauth.Strategy.Facebook, [
      default_scope: "email, public_profile, user_friends",
      profile_fields: "name, email, first_name, last_name",
      request_path: "/en/auth/facebook",
      callback_path: "/en/auth/facebook/callback"
      ]
    },
    identity: { Ueberauth.Strategy.Identity, [
      callback_methods: ["POST"],
      request_path: "/en/auth/identity",
      callback_path: "/en/auth/identity/callback"
    ]}
  ],
  json_library: Jason,
  base_path: "/:locale/auth"

current workaround is to duplicate providers per each lang for gettext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant