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

Overwrite activation url with custom plugin #45

Open
abdullah10182 opened this issue Dec 16, 2020 · 5 comments
Open

Overwrite activation url with custom plugin #45

abdullah10182 opened this issue Dec 16, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@abdullah10182
Copy link

Hi,
I'm trying to overwrite the activation and password reset urls so I can customize these per installation in an .env file for example.

So far I have a custom plugin in which I have this in the Plugin.php file.

use RLuders\JWTAuth\Models\Settings as UserSettings; 

 public function boot(){
   UserSettings::set('activation_url', 'http://localhost:8080/account-activation?code={code}');
 }

This works, the problem is that it clears all the fields in the settings section for the plugin in the backend.
The values still exist, they just don't display anymore in their corresponding fields in the settings area.

Any hint what I'm doing wrong?

Thanks,
A.

@rluders
Copy link
Owner

rluders commented Dec 18, 2020

Hello, @abdullah10182 I guess that this PR that will be merged soon can help you to overwrite it using a custom configuration file.

It will be released this weekend, or maybe today. Then I can test it.

@abdullah10182
Copy link
Author

Great, thanks for the awesome work.
Will make sure to test it when it comes out.

@rluders
Copy link
Owner

rluders commented Dec 18, 2020

OK. Just checked, and it seems that the PR doesn't change the Plugin's settings, after all.

So, in fact, what I'll need to do, is to convert your PR into a feature request. 'Cause, checking the code (It was written a long time ago, sorry) I didn't intendet to support this kind of configuration, but it seems interesting.

Let me just check if it would be viable.

UPDATE: The main thing is that it gets the default values from the file, then it replaces the value by the ones available at the database.

@rluders rluders added enhancement New feature or request support User support tickets labels Dec 18, 2020
@rluders rluders self-assigned this Dec 18, 2020
@rluders rluders added this to the 1.5.0 milestone Jan 3, 2021
@rluders
Copy link
Owner

rluders commented Jan 22, 2021

I wasn't able to fully test this one, but in my quick tests, it seems that the CMS Settings will always replace the values from the config file.

@abdullah10182 do you have any feedback about this one?

@rluders rluders added 🤞 testing It was fixed and is now being validaded/tested. not a bug It is not really a bug, but it is related by the plugin. and removed support User support tickets labels Jan 22, 2021
@abdullah10182
Copy link
Author

For now I just manually change the urls whenever I sync the database or move anything to another url. Not a big deal.
But would be nice if the url settings where configurable through code in my custom plugin, to make these dynamic per environment.

@rluders rluders removed not a bug It is not really a bug, but it is related by the plugin. 🤞 testing It was fixed and is now being validaded/tested. labels Jan 23, 2021
@rluders rluders removed this from the 1.5.0 milestone Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants