summaryrefslogtreecommitdiffstats
path: root/src/server/Startup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Startup.cs')
-rw-r--r--src/server/Startup.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/server/Startup.cs b/src/server/Startup.cs
index aa07f33..8156444 100644
--- a/src/server/Startup.cs
+++ b/src/server/Startup.cs
@@ -1,5 +1,3 @@
-using AspNet.Security.OAuth.GitHub;
-
namespace IOL.BookmarkThing.Server;
public class Startup
@@ -15,7 +13,7 @@ public class Startup
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) {
services.AddDataProtection()
- .PersistKeysToFileSystem(new(AppPaths.DataProtectionKeys.HostPath));
+ .PersistKeysToFileSystem(new DirectoryInfo(AppPaths.DataProtectionKeys.HostPath));
StartupTasks.Execute();
@@ -52,7 +50,7 @@ public class Startup
services.AddAuthentication(options => {
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
- options.DefaultChallengeScheme = GitHubAuthenticationDefaults.AuthenticationScheme;
+ options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
.AddCookie(options => {
options.Cookie.Name = "bookmarkthing_session";
@@ -71,7 +69,6 @@ public class Startup
options.ClientSecret = Configuration.GetValue<string>("GH_CLIENT_SECRET");
options.ClientId = Configuration.GetValue<string>("GH_CLIENT_ID");
options.SaveTokens = true;
- options.ClaimActions.MapJsonKey(AppClaims.GITHUB_ID, "id");
options.CorrelationCookie = new CookieBuilder {
Name = "gh_correlation",
SameSite = SameSiteMode.Lax,
@@ -132,7 +129,7 @@ public class Startup
app.UseCors(x => x
.AllowAnyMethod()
.AllowAnyHeader()
- .SetIsOriginAllowed(_ => true) // allow any origin
+ .WithOrigins("http://localhost:3000")
.AllowCredentials()); // allow credentials
}