Files
secure-core/SecureCore/Controllers/AuthController.cs
T

23 lines
651 B
C#

using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SecureCore.Controllers
{
[Route("[controller]")]
[ApiController]
public class AuthController : Controller
{
[HttpPost("login")]
[AcceptVerbs("POST")]
public IActionResult Login(LoginInfo info)
{
var (hash, salt) = Authentication.HashPassword(info.Password);
return Ok($"Session Key: {Authentication.CreateSessionId()}{Environment.NewLine}Password Hash: {hash}{Environment.NewLine}Salt: {salt}{Environment.NewLine}");
}
}
}