mirror of
https://github.com/ditkrg/AuthorizationServerDemos.git
synced 2026-01-23 08:26:56 +00:00
Removes the dummy data
This commit is contained in:
parent
43596d741e
commit
dac893275a
@ -34,6 +34,15 @@ namespace OidcSamples.TrafficPoliceApi
|
|||||||
{
|
{
|
||||||
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap["sub"] = "sub";
|
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap["sub"] = "sub";
|
||||||
|
|
||||||
|
services.AddCors(options =>
|
||||||
|
{
|
||||||
|
options.AddPolicy(name: "Default",
|
||||||
|
builder =>
|
||||||
|
{
|
||||||
|
builder.AllowAnyHeader().AllowAnyOrigin().AllowAnyMethod();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
services.AddDbContext<ApplicationDbContext>(options =>
|
services.AddDbContext<ApplicationDbContext>(options =>
|
||||||
options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection"))
|
options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection"))
|
||||||
.UseSnakeCaseNamingConvention()
|
.UseSnakeCaseNamingConvention()
|
||||||
@ -87,6 +96,8 @@ namespace OidcSamples.TrafficPoliceApi
|
|||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
|
app.UseCors("Default");
|
||||||
|
|
||||||
// 2. Enable authentication middleware
|
// 2. Enable authentication middleware
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|||||||
@ -16,44 +16,7 @@ const VehiclesMain = () => {
|
|||||||
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
// Initial state must be null ** Temporary **
|
const [vehicleData, setVehicleData] = useState(null);
|
||||||
const [vehicleData, setVehicleData] = useState([
|
|
||||||
{
|
|
||||||
id: Math.floor(Math.random() * 200) + 1,
|
|
||||||
color: "White",
|
|
||||||
model: "Toyota Camry",
|
|
||||||
licensePlate: "14324235",
|
|
||||||
type: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: Math.floor(Math.random() * 200) + 1,
|
|
||||||
color: "Black",
|
|
||||||
model: "Honda Accord",
|
|
||||||
licensePlate: "8765658",
|
|
||||||
type: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: Math.floor(Math.random() * 200) + 1,
|
|
||||||
color: "Beige",
|
|
||||||
model: "Toyota Corolla",
|
|
||||||
licensePlate: "235464",
|
|
||||||
type: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: Math.floor(Math.random() * 200) + 1,
|
|
||||||
color: "Grey",
|
|
||||||
model: "Toyota Yaris",
|
|
||||||
licensePlate: "1878767",
|
|
||||||
type: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: Math.floor(Math.random() * 200) + 1,
|
|
||||||
color: "White",
|
|
||||||
model: "Toyota Camry",
|
|
||||||
licensePlate: "9956443",
|
|
||||||
type: 1,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getVehicles();
|
getVehicles();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user