How to allow only invited users to see a website (and register for an account)?

StackOverflow https://stackoverflow.com/questions/22306626

  •  12-06-2023
  •  | 
  •  

Question

I'm working on a website that that allows a user to register via a LinkedIn account or user registration form. This website is private and should only be accessible to people who have been invited to register for an account to view the contents of the site. I know that search engines will crawl it and list it in organic search results. How do I make sure that only invited people can get to the registration page?

I was thinking of using a field value pair in the query string, like "?invite=3sdlfwe" and only allowing people that have arrived on the page with this query string to see the registration page.

Are there better methods of doing this out there?

Was it helpful?

Solution

You can create invitation tokens for each invite in the database. The tokens would be added to the query paramethers like or url path, e.g.

http://www.example.com/register/?token=3sdlfwe

or

http://www.example.com/register/3sdlfwe/

When it is used once, it gets deleted and becomes invalid.

OTHER TIPS

More than a method, you could use API integrations, probably using wordpress could be better and faster and then make your pages privates and install a Social plugin in order to integrate wordpress with social networks like LindkedIn

Best Regards

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top