TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
975 stars 306 forks source link

Approve user link in "user is waiting for approval" email #3396

Closed johanstokking closed 2 years ago

johanstokking commented 4 years ago

Summary

Add an "approve" link in the email sent to admins when a user is waiting for approval. This link would automatically set the user state to reviewed and approved.

Why do we need this?

So that users don't have to go in the concerning Console, to User Management, find the user and set state reviewed and approved. This is error prone also when mixing up the user IDs.

What is already there? What do you see now?

The email is currently:

Dear <my name>,

User "<user id>" wants to join <cluster name>.

You can approve or reject them in the Console or using the Command-line interface.

You can read how exactly to do this in the user management guide:
https://thethingsstack.io/latest/getting-started/user-management/

What is missing? What do you want to see?

Add a direct link to approve the user, or at least to go straight to the user edit page where the user state can be set.

This link shouldn't include an access token; the Console would login with the browser session or the page shows up after logging in via a redirect.

How do you propose to implement this?

I suppose it's mostly a matter of adapting the email templates, but we might need some extra parameters.

How do you propose to test this?

Integration testing

Can you do this yourself and submit a Pull Request?

No

pgalic96 commented 2 years ago

I will close this since its (more or less) already implemented in https://github.com/TheThingsNetwork/lorawan-stack/pull/3678 .

The text is following now:

Dear admin,

User "hylke" wants to join The Things Stack for LoRaWAN.

You can go to http://localhost:1885/console/admin/user-management/hylke to view and approve (or reject) the user.

If you prefer to use the command-line interface, you can run the following command:

ttn-lw-cli users set hylke --state APPROVED (or --state REJECTED)