Skip to content

Commit

Permalink
customize configs
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Nov 5, 2023
1 parent 2619d1c commit 667872a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ App_Data/
*.userosscache
*.sln.docstates
*.secrets.cs
*.patch

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
6 changes: 3 additions & 3 deletions BlazorDiffusion.ServiceInterface/EmailServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public object Any(SendEmail request)
? new MailAddress(Config.DevToEmail)
: new MailAddress(request.To, request.ToName);

var emailFrom = new MailAddress(Config.DefaultFromEmail, Config.DefaultFromName);
var emailFrom = new MailAddress(Config.FromEmail, Config.FromName);

var msg = new MailMessage(emailFrom, emailTo)
{
Expand All @@ -32,9 +32,9 @@ public object Any(SendEmail request)
IsBodyHtml = request.BodyHtml != null,
};

if (Config.EchoToEmail != null)
if (Config.Bcc != null)
{
msg.Bcc.Add(new MailAddress(Config.EchoToEmail));
msg.Bcc.Add(new MailAddress(Config.Bcc));
}

client.Send(msg);
Expand Down
7 changes: 3 additions & 4 deletions BlazorDiffusion.ServiceModel/SmtpConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

public class SmtpConfig
{
public string UserId { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public string Host { get; set; }
public int Port { get; set; }
public string DefaultFromEmail { get; set; }
public string DefaultFromName { get; set; }
public string FromEmail { get; set; }
public string FromName { get; set; }
public string DevToEmail { get; set; }
public string EchoToEmail { get; set; }
public string Bcc { get; set; }
}
4 changes: 2 additions & 2 deletions BlazorDiffusion/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
options.SaveTokens = true;
})
.AddMicrosoftAccount(options => { /* Create App https://apps.dev.microsoft.com */
options.ClientId = config["oauth.microsoftgraph.AppId"]!;
options.ClientSecret = config["oauth.microsoftgraph.AppSecret"]!;
options.ClientId = config["oauth.microsof.AppId"]!;
options.ClientSecret = config["oauth.microsof.AppSecret"]!;
options.SaveTokens = true;
})
.AddIdentityCookies();
Expand Down
8 changes: 2 additions & 6 deletions BlazorDiffusion/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
}
},

"oauth.RedirectUrl": "https://localhost:5001/",
"oauth.CallbackUrl": "https://localhost:5001/signin-{0}",
"oauth.facebook.Permissions": [ "email", "public_profile" ],
"oauth.facebook.AppId": "231464590266507",
"oauth.facebook.AppSecret": "9dd6ce54b4405dd1325d271d2419bc34",
"oauth.google.ConsumerKey": "871587245318-ikriaoce2578d67qosmf19eg8m44mh2b.apps.googleusercontent.com",
"oauth.google.ConsumerSecret": "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",
"oauth.microsoftgraph.AppId": "ba0d5aec-5e6e-4a7e-b02f-636ffd0111b5",
"oauth.microsoftgraph.AppSecret": "1Qm7Q~9JeytqR7UdKK~USDC7lbk0BOeOUnuks",
"oauth.microsoftgraph.SavePhoto": "true",
"oauth.microsoftgraph.SavePhotoSize": "96x96"
"oauth.microsoft.AppId": "ba0d5aec-5e6e-4a7e-b02f-636ffd0111b5",
"oauth.microsoft.AppSecret": "1Qm7Q~9JeytqR7UdKK~USDC7lbk0BOeOUnuks"
}

0 comments on commit 667872a

Please sign in to comment.