Skip to content

Commit bd994a8

Browse files
committed
Simplify index
1 parent e9437ac commit bd994a8

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/frontend.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use serde::Deserialize;
1212
use tower_sessions::Session;
1313

1414
use crate::{
15-
auth::github_auth_redirect_url,
1615
config::CourseScheduleWithRegisterSheetId,
1716
course::{
1817
fetch_batch_metadata, get_batch, Attendance, Batch, BatchMetadata, Course, Submission,
@@ -248,19 +247,13 @@ struct ReviewersTemplate {
248247
pub now: chrono::DateTime<chrono::Utc>,
249248
}
250249

251-
pub async fn index(
252-
State(server_state): State<ServerState>,
253-
OriginalUri(original_uri): OriginalUri,
254-
) -> Result<Html<String>, Error> {
255-
let login_url = github_auth_redirect_url(&server_state, original_uri).await?;
256-
Ok(Html(Index { login_url }.render().unwrap()))
250+
pub async fn index() -> Html<String> {
251+
Html(Index {}.render().unwrap())
257252
}
258253

259254
#[derive(Template)]
260255
#[template(path = "index.html")]
261-
struct Index {
262-
pub login_url: Uri,
263-
}
256+
struct Index {}
264257

265258
#[derive(Template)]
266259
#[template(path = "redirect.html")]

templates/index.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
<html>
33
<body>
44
<ul>
5-
<li><a href="{{ login_url }}">Login</a></li>
65
<li><a href="/courses">Courses</a></li>
7-
<li><a href="/courses/itp/reviewers">ITP reviewers</a></li>
8-
<li><a href="/courses/sdc/reviewers">SDC reviewers</a></li>
96
</ul>
107
</body>
118
</html>

0 commit comments

Comments
 (0)