Rename debug user
This commit is contained in:
parent
b034bce7cc
commit
1d51d32bc8
|
@ -1,11 +1,11 @@
|
||||||
# Trainav
|
# Trainav
|
||||||
|
|
||||||
## DISCLAIMER
|
## DISCLAIMER
|
||||||
- This app uses the `Remote-User` header for authentication. For production use an auth proxy like Authelia is required. In development mode the user is set to `zotan` by default. This can be changed in `AuthUtil.cs`.
|
- This app uses the `Remote-User` header for authentication. For production use an auth proxy like Authelia is required. In development mode the user is set to `debuguser` by default. This can be changed in `AuthUtil.cs`.
|
||||||
|
|
||||||
## Development / testing requirements
|
## Development / testing requirements
|
||||||
- .NET Core SDK (version 6.0 or higher; arch package `dotnet-sdk`)
|
- .NET Core SDK (version 7.0 or higher; arch package `dotnet-sdk`)
|
||||||
- ASP.NET Core Runtime (version 6.0 or higher; arch package `aspnet-runtime`)
|
- ASP.NET Core Runtime (version 7.0 or higher; arch package `aspnet-runtime`)
|
||||||
|
|
||||||
- `cd trainav.web`
|
- `cd trainav.web`
|
||||||
- `dotnet run`
|
- `dotnet run`
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace trainav.web.Utils;
|
||||||
public static class AuthUtil {
|
public static class AuthUtil {
|
||||||
public static string GetRemoteUser(HttpContext ctx, Database.DbConn db) {
|
public static string GetRemoteUser(HttpContext ctx, Database.DbConn db) {
|
||||||
#if (DEBUG)
|
#if (DEBUG)
|
||||||
const string remoteUser = "zotan";
|
const string remoteUser = "debuguser";
|
||||||
#else
|
#else
|
||||||
var remoteUser = ctx.Request.Headers["Remote-User"];
|
var remoteUser = ctx.Request.Headers["Remote-User"];
|
||||||
#endif
|
#endif
|
||||||
|
|
Reference in a new issue