From 009672b81a0f701808e4ded231078980b20170e1 Mon Sep 17 00:00:00 2001 From: Kim Date: Mon, 23 Oct 2023 16:40:28 +0200 Subject: [PATCH] even easier new user email --- .gitea/workflows/stage-deploy.yaml | 6 +++--- csharp/App/Backend/Controller.cs | 8 +------- csharp/App/Backend/Email/Email.cs | 5 ++--- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/stage-deploy.yaml b/.gitea/workflows/stage-deploy.yaml index 0199b7c17..368a8dceb 100644 --- a/.gitea/workflows/stage-deploy.yaml +++ b/.gitea/workflows/stage-deploy.yaml @@ -24,13 +24,13 @@ jobs: - name: Configure SSH run: | mkdir -p ~/.ssh/ - echo "$SSH_KEY" > ~/.ssh/staging.key - chmod 600 ~/.ssh/staging.key + echo "$SSH_KEY" > ~/.ssh/staging.pub + chmod 600 ~/.ssh/staging.pub cat >>~/.ssh/config < NewUserLogin(String email) - { - return Redirect($"https://monitor.innov.energy/?username={email}"); + return Redirect($"https://monitor.innov.energy/?username={user.Email}&reset=true"); } } diff --git a/csharp/App/Backend/Email/Email.cs b/csharp/App/Backend/Email/Email.cs index ae22ce77c..c1c466f39 100644 --- a/csharp/App/Backend/Email/Email.cs +++ b/csharp/App/Backend/Email/Email.cs @@ -59,7 +59,7 @@ public static class Email var config = JsonSerializer.Deserialize(File.OpenRead("./Resources/smtpConfig.json"))!; //todo am I right? - const String resetLink = "https://monitor.innov.energy/api/NewUserLogin"; + var resetLink = $"https://monitor.innov.energy/?username={emailRecipientUser.Email}"; var mailer = new Mailer(); try @@ -71,8 +71,7 @@ public static class Email mailer.Subject("Your new Innovenergy-Account"); mailer.Body("Dear " + emailRecipientUser.Name + "\n To set your password and log in to your Innovenergy-Account open this link:" - + resetLink + "?email=" - + emailRecipientUser.Email); + + resetLink); return mailer.SendEmailUsingSmtpConfig(config); }