Skip to content

Commit

Permalink
Replaced env variables to find deploy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gritNgo committed Aug 14, 2024
1 parent 8339c8b commit 19f17bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
9 changes: 3 additions & 6 deletions Decibels.DataAccess/DbInitializer/DbInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,18 @@ public void Initialize()
_roleManager.CreateAsync(new IdentityRole(StaticDetails.Role_Admin)).GetAwaiter().GetResult();
_roleManager.CreateAsync(new IdentityRole(StaticDetails.Role_Company)).GetAwaiter().GetResult();

var adminEmail = Environment.GetEnvironmentVariable("ADMIN_EMAIL");
var adminPassword = Environment.GetEnvironmentVariable("ADMIN_PASSWORD");

// if there are no Roles, create admin user
_userManager.CreateAsync(new ApplicationUser
{
UserName = adminEmail,
Email = adminEmail,
UserName = "admin123@gmail.com",
Email = "admin123@gmail.com",
Name = "Fiorenso Fernando",
PhoneNumber = "1231231230",
Street = "123 my street",
State = "UT",
PostalCode = "96024",
City = "FioLand",
}, adminPassword).GetAwaiter().GetResult();
}, "Admin123!").GetAwaiter().GetResult();

// once it's created, retrieve by email from db
ApplicationUser user = _db.ApplicationUsers.FirstOrDefault(u => u.Email == adminEmail);
Expand Down
4 changes: 2 additions & 2 deletions DecibelsWeb/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
});

builder.Services.AddAuthentication().AddFacebook(options => {
options.AppId = Environment.GetEnvironmentVariable("FB_APP_ID");
options.AppSecret = Environment.GetEnvironmentVariable("FB_APP_SECRET");
options.AppId = Environment.GetEnvironmentVariable("866082252111647");
options.AppSecret = Environment.GetEnvironmentVariable("1fb194a31882a20c76445678152e1920");
});


Expand Down
6 changes: 1 addition & 5 deletions DecibelsWeb/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"FB_APP_ID": "866082252111647",
"FB_APP_SECRET": "1fb194a31882a20c76445678152e1920",
"ADMIN_EMAIL": "admin123@gmail.com",
"ADMIN_PASSWORD": "Admin123!"
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7267;http://localhost:5135"
Expand Down

0 comments on commit 19f17bf

Please sign in to comment.