even easier new user email
This commit is contained in:
parent
6723108e48
commit
009672b81a
|
@ -24,13 +24,13 @@ jobs:
|
||||||
- name: Configure SSH
|
- name: Configure SSH
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh/
|
mkdir -p ~/.ssh/
|
||||||
echo "$SSH_KEY" > ~/.ssh/staging.key
|
echo "$SSH_KEY" > ~/.ssh/staging.pub
|
||||||
chmod 600 ~/.ssh/staging.key
|
chmod 600 ~/.ssh/staging.pub
|
||||||
cat >>~/.ssh/config <<END
|
cat >>~/.ssh/config <<END
|
||||||
Host staging
|
Host staging
|
||||||
HostName $SSH_HOST
|
HostName $SSH_HOST
|
||||||
User $SSH_USER
|
User $SSH_USER
|
||||||
IdentityFile ~/.ssh/staging.key
|
IdentityFile ~/.ssh/staging.pub
|
||||||
StrictHostKeyChecking no
|
StrictHostKeyChecking no
|
||||||
END
|
END
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -490,13 +490,7 @@ public class Controller : ControllerBase
|
||||||
return Unauthorized();
|
return Unauthorized();
|
||||||
}
|
}
|
||||||
// Console.WriteLine("HELP");
|
// Console.WriteLine("HELP");
|
||||||
return Redirect($"https://monitor.innov.energy/?username={user.Email}");
|
return Redirect($"https://monitor.innov.energy/?username={user.Email}&reset=true");
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet(nameof(NewUserLogin))]
|
|
||||||
public ActionResult<Object> NewUserLogin(String email)
|
|
||||||
{
|
|
||||||
return Redirect($"https://monitor.innov.energy/?username={email}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public static class Email
|
||||||
var config = JsonSerializer.Deserialize<SmtpConfig>(File.OpenRead("./Resources/smtpConfig.json"))!;
|
var config = JsonSerializer.Deserialize<SmtpConfig>(File.OpenRead("./Resources/smtpConfig.json"))!;
|
||||||
|
|
||||||
//todo am I right?
|
//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();
|
var mailer = new Mailer();
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -71,8 +71,7 @@ public static class Email
|
||||||
mailer.Subject("Your new Innovenergy-Account");
|
mailer.Subject("Your new Innovenergy-Account");
|
||||||
mailer.Body("Dear " + emailRecipientUser.Name
|
mailer.Body("Dear " + emailRecipientUser.Name
|
||||||
+ "\n To set your password and log in to your Innovenergy-Account open this link:"
|
+ "\n To set your password and log in to your Innovenergy-Account open this link:"
|
||||||
+ resetLink + "?email="
|
+ resetLink);
|
||||||
+ emailRecipientUser.Email);
|
|
||||||
|
|
||||||
return mailer.SendEmailUsingSmtpConfig(config);
|
return mailer.SendEmailUsingSmtpConfig(config);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue