Skip to content

Feature Request: Invite-Only Mode #172

Closed

Description

@imnotjames

As far as I can tell this isn't currently supported.

It'd be helpful to have the ability to restrict sign-ups after the initial user has signed up on self-hosted installations.

As a self-hosted administrator of an instance, I want to support magic links but not allow ANYONE to sign up so I can avoid spam users.


This is something I'll be working on as long as there's no qualms with it getting merged in.

Activity

  1. KMKoushik commented on Jan 25, 2025

    @KMKoushik
    Contributor

    thank you

  2. ivanzgroot commented on Jan 26, 2025

    @ivanzgroot

    Hello, I just got my instance working today. After some problems with the login screen not displaying that I solved described in my Issue I opened before.
    Now I am able to register/login as first user, but the ones I invite after don't receive the invitation e-mail. Is there something new been added yesterday that has yet to be documented? or am I doing something wrong?
    Thanks in advance
    PS. Invites are enabled in the variables file.

  3. imnotjames commented on Jan 26, 2025

    @imnotjames
    ContributorAuthor

    Hello, I just got my instance working today. After some problems with the login screen not displaying that I solved described in my Issue I opened before. Now I am able to register/login as first user, but the ones I invite after don't receive the invitation e-mail. Is there something new been added yesterday that has yet to be documented? or am I doing something wrong? Thanks in advance PS. Invites are enabled in the variables file.

    Pretty sure that's unrelated to this issue as this issue is for enabling an "invite-only" mode.

  4. imnotjames commented on Jan 26, 2025

    @imnotjames
    ContributorAuthor

    Okay, taking a look: next-auth sure doesn't make this easy.

    We can't hook in before a user is created across all adapters & auth mechanisms.

    The createUser event is fired AFTER the user is created but we can hook before individual providers I guess..

    Email: sendVerificationRequest can check if the flag is set and if the user already exists before it sends the verification request?
    Various other providers are all over the place.

    We could wrap the prisma provider and disallow the createUser helper if an env var is set.

  5. KMKoushik commented on Jan 26, 2025

    @KMKoushik
    Contributor
  6. ivanzgroot commented on Jan 26, 2025

    @ivanzgroot

    yes, the smtp is configured correctly. I think it is some kind of weird bug having to do with Safari on iOS.
    Both of the users weren't getting the e-mail for login and both of them were using Safari on iOS. I tried logging in for them on my Macbook and they received the e-mail with the token.
    After they added the PWA to their home screens they tried logging in on their own and it worked.
    This is why I think it had to do with Safari on iOS, but it might also just be coincidence.

  7. KMKoushik commented on Jan 27, 2025

    @KMKoushik
    Contributor

    i would say it's coincidence cuz, pwa still opens in safari

  8. KMKoushik commented on Jan 27, 2025

    @KMKoushik
    Contributor

    also as @imnotjames mentioned, can you see the email from your email account?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions