Skip to content

Commit fdb5633

Browse files
FrostyApeOneFrostyApeOne
authored andcommitted
Removed redundant code from the index page.
1 parent ced9fad commit fdb5633

1 file changed

Lines changed: 3 additions & 27 deletions

File tree

src/DfE.ExternalApplications.Web/Pages/Index.cshtml.cs

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,9 @@ public IndexModel(ILogger<IndexModel> logger, IApplicationsClient usersClient)
2424
_applicationsClient = usersClient;
2525
}
2626

27-
public async Task OnGet()
27+
public Task OnGet()
2828
{
29-
30-
_applicationsClient.GetMyApplicationsAsync();
31-
32-
Email = User.FindFirst(ClaimTypes.Email)?.Value
33-
?? User.FindFirst("email")?.Value;
34-
35-
FirstName = User.FindFirst(ClaimTypes.GivenName)?.Value;
36-
LastName = User.FindFirst(ClaimTypes.Surname)?.Value;
37-
38-
var orgJson = User.FindFirst("organisation")?.Value;
39-
if (!string.IsNullOrEmpty(orgJson))
40-
{
41-
try
42-
{
43-
using var doc = JsonDocument.Parse(orgJson);
44-
OrganisationName = doc.RootElement
45-
.GetProperty("name")
46-
.GetString();
47-
}
48-
catch
49-
{
50-
OrganisationName = null;
51-
}
52-
}
53-
29+
return Task.CompletedTask;
5430
}
5531
}
56-
}
32+
}

0 commit comments

Comments
 (0)