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

Customized user authentication function #137

Open
ravid007 opened this issue Dec 4, 2022 · 6 comments
Open

Customized user authentication function #137

ravid007 opened this issue Dec 4, 2022 · 6 comments

Comments

@ravid007
Copy link

ravid007 commented Dec 4, 2022

Hi,
I would like to add my own function for user authentication in the middle of the flow, right after the authentication with google and before the user is registered or signed in if he already exists.
Is it possible to use the rtcamp.google_user_authenticated hook somehow to stop the flow and prevent from creating a user or sign-in a user?
Of course I prefer to use hooks (filters) and not to make any changes in the code of the plugin.
If that's not possible, I'd be happy to add it as a feature request.
Thanks!

@aviral-mittal aviral-mittal added the priority/normal something that should be fixed sooner label Dec 6, 2022
@elifvish
Copy link
Contributor

@ravid007 rtcamp.google_user_authenticated hook can be used to obstruct the flow for user login.
User creation however cannot be obstructed using this hook.
You can use this hook rtcamp.google_user_created which is fired after user data insertion. To add additional functionality or checks for user creation.

@elifvish elifvish removed the priority/normal something that should be fixed sooner label Dec 17, 2022
@ravid007
Copy link
Author

ravid007 commented Dec 22, 2022

@elifvish If I understand correctly, the rtcamp.google_user_created hook is fired after the user has been already created and registered successfully. Isn't that too late for additional functionality and checks for user creation?
I want to decide whether to create the user or not based on his email address.

@elifvish
Copy link
Contributor

@ravid007 If your goal is to allow user registration from specific domains (domain in email) you can add domains you want to whitelist in Whitelisted Domains field in settings page.

@ravid007
Copy link
Author

@elifvish I am familiar with that cool functionality, but unfortunately the login authentication is based on a list of specific Gmail address from a DB server. I'm pretty sure that the correct place for authentication functionality is the rtcamp.google_user_authenticated hook by returning a Boolean TRUE/FALSE value for commence the registration or break it.
I think It can be a very nice and useful feature for this plugin.

@ravid007
Copy link
Author

ravid007 commented Jan 25, 2023

@elifvish @aviral-mittal Could you please consider adding this feature in next release please? that will be very helpful.
Thanks.

@aviral-mittal
Copy link

@ravid007 We have not yet finalised adding this in next release, however, we will consider. We will update this issue with whatever decision we go ahead with. Hope you continue to enjoy using the plugin. :)

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

4 participants