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

Allow external login page #935

Closed
2 of 5 tasks
Thomas-Philippot opened this issue Oct 24, 2024 · 1 comment · Fixed by #936
Closed
2 of 5 tasks

Allow external login page #935

Thomas-Philippot opened this issue Oct 24, 2024 · 1 comment · Fixed by #936
Labels
enhancement An improvement that needs to be added

Comments

@Thomas-Philippot
Copy link
Contributor

Thomas-Philippot commented Oct 24, 2024

Describe the feature

It would be great t allow external login page on local provider.

provider: {
  type: 'local',
  pages: {
    login: 'http://my-external-login-page',
  },
},

Currently this triggers an error : Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })

How would you implement this?

Changing the auth.js middleware to check if authConfig.provider.pages.login is an external link

const external = /^https?:\/\/\S+/.test(authConfig.provider.pages.login)
return navigateTo(authConfig.provider.pages.login.path, { external });

Additional information

  • Would you be willing to help implement this feature?

Provider

  • AuthJS
  • Local
  • Refresh
  • New Provider
@Thomas-Philippot Thomas-Philippot added enhancement An improvement that needs to be added pending An issue waiting for triage labels Oct 24, 2024
@jordi-tomas
Copy link

Hi, that solves my problem too. It would be interesting to have that check.

phoenix-ru added a commit that referenced this issue Dec 12, 2024
* allow external link as login page

* allow external login page

* fix typecheck

* chore: adjust the external handling

---------

Co-authored-by: Thomas <thomas.philippot@labo-mylab.fr>
Co-authored-by: Zoey <zoeykaiser8@gmail.com>
Co-authored-by: Marsel Shaikhin <phoenix.apps@yahoo.com>
@phoenix-ru phoenix-ru removed the pending An issue waiting for triage label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement that needs to be added
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants