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

Adding register option into login page #145

Open
mahsashadi opened this issue Feb 6, 2021 · 7 comments
Open

Adding register option into login page #145

mahsashadi opened this issue Feb 6, 2021 · 7 comments
Assignees

Comments

@mahsashadi
Copy link
Contributor

Hi.
I plan to add register option into login page, so the registered user can login into OSjs desktop with his/her new account.
What changes do I need to apply and which files need to be modified?

@andersevenrud
Copy link
Member

Hi,

The underlying authentication system supports registration, however the standard provided login UI box does not.

Are you using a custom login box ? If so then I can show you how to implement this.


FYI: I released @osjs/[email protected] today with some new events to help out with this.

It adds register:* equivalent events for the login:* ones that are in this article: https://manual.os-js.org/guide/login/#adapter

@andersevenrud
Copy link
Member

however the standard provided login UI box does not.

I could add support for this, but not sure when I have time for this.

@mahsashadi
Copy link
Contributor Author

Are you using a custom login box ? If so then I can show you how to implement this

No, we are using the default login box. Maybe we only need to add one other input field in client configuration, in addition to username and password.

We develop an adapter for AuthServiceProvider which uses a remote account to authenticate.
We aim at having register option to add a new remote account and login to OSjs with this new account.

@andersevenrud
Copy link
Member

Maybe we only need to add one other input field in client configuration, in addition to username and password.

Currently, adding a button to the configuration doesn't really do anything. The dialog needs to be changed in the following way:

  • Change input button to button.
  • Update configuration with this change, and have a special attribute on the button that triggers submits
  • Change the UI dialog to support submission via buttons and not the underlying form
  • Hook up the new events to correctly show loading, errors, etc.

We develop an adapter for AuthServiceProvider which uses a remote account to authenticate.

Just use the register() method here on your adapter. This has the same signature as login.

@mahsashadi
Copy link
Contributor Author

Currently, adding a button to the configuration doesn't really do anything

I think it is misunderstood, I mean that we did not write an adapter for login page. We have Username, Password, and one additional Domain input filed in login page.

So as I understand, the login and register page/from are the same and the user can choose whether login button or register button. A different page/form is not loaded for the user registration.

I could add support for this, but not sure when I have time for this.

Fortunately we are not in hurry if you plan to add this option.

@andersevenrud
Copy link
Member

So as I understand, the login and register page/from are the same and the user can choose whether login button or register button.

Correct. This was my thought.

A different page/form is not loaded for the user registration.

It could be changed to have to views: login and registration. But this would involve a lot of changes because of how it is designed because of the configuration options to change the layout.

I think I might just rewrite the login UI and export this as a class that can be inherited to change both the behavior and layouts instead of the configuration (and have some backward compatibility for it all).

Fortunately we are not in hurry if you plan to add this option.

Great. If you have some ideas or requirements put them here and I will take it into consideration when I start looking at this.

@mahsashadi
Copy link
Contributor Author

Great. If you have some ideas or requirements put them here and I will take it into consideration when I start looking at this.

Thanks a lot, I will leave my ideas here if there is any.
So we are waiting for you to support this 👍

@andersevenrud andersevenrud self-assigned this Apr 10, 2022
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

2 participants