Exemplo n.º 1
0
        private static ContentResult generateBadRequestLogin(string message)
        {
            BasicTemplater.errors.Add(message);
            var toReturn = new ContentResult {
                ContentType = "text/html",
                StatusCode  = Status400BadRequest,
                Content     = BasicTemplater.GenerateLoginPage()
            };

            return(toReturn);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetLoginPage()
        {
            await CheckSessionForUser();

            if (user == null)
            {
                return(new ContentResult()
                {
                    Content = BasicTemplater.GenerateLoginPage(),
                    StatusCode = Status200OK,
                    ContentType = "text/html"
                });
            }

            return(new ContentResult()
            {
                Content = $"User: {user.username}"
            });
        }