You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
templates: translate a lot more stuff
This commit is contained in:
@ -105,7 +105,8 @@ pub async fn get(
|
||||
if clock.now() > login.created_at + Duration::minutes(30) {
|
||||
let ctx = ErrorContext::new()
|
||||
.with_code("compat_sso_login_expired")
|
||||
.with_description("This login session expired.".to_owned());
|
||||
.with_description("This login session expired.".to_owned())
|
||||
.with_language(&locale);
|
||||
|
||||
let content = templates.render_error(&ctx)?;
|
||||
return Ok((cookie_jar, Html(content)).into_response());
|
||||
@ -131,6 +132,7 @@ pub async fn post(
|
||||
mut rng: BoxRng,
|
||||
clock: BoxClock,
|
||||
mut repo: BoxRepository,
|
||||
PreferredLanguage(locale): PreferredLanguage,
|
||||
State(templates): State<Templates>,
|
||||
cookie_jar: CookieJar,
|
||||
Path(id): Path<Ulid>,
|
||||
@ -173,7 +175,8 @@ pub async fn post(
|
||||
if clock.now() > login.created_at + Duration::minutes(30) {
|
||||
let ctx = ErrorContext::new()
|
||||
.with_code("compat_sso_login_expired")
|
||||
.with_description("This login session expired.".to_owned());
|
||||
.with_description("This login session expired.".to_owned())
|
||||
.with_language(&locale);
|
||||
|
||||
let content = templates.render_error(&ctx)?;
|
||||
return Ok((cookie_jar, Html(content)).into_response());
|
||||
|
@ -77,6 +77,7 @@ pub(crate) async fn post(
|
||||
mut rng: BoxRng,
|
||||
clock: BoxClock,
|
||||
mut repo: BoxRepository,
|
||||
PreferredLanguage(locale): PreferredLanguage,
|
||||
mut policy: Policy,
|
||||
cookie_jar: CookieJar,
|
||||
activity_tracker: BoundActivityTracker,
|
||||
@ -124,7 +125,7 @@ pub(crate) async fn post(
|
||||
// verify page
|
||||
let next = if user_email.confirmed_at.is_none() {
|
||||
repo.job()
|
||||
.schedule_job(VerifyEmailJob::new(&user_email))
|
||||
.schedule_job(VerifyEmailJob::new(&user_email).with_language(locale.to_string()))
|
||||
.await?;
|
||||
|
||||
let next = mas_router::AccountVerifyEmail::new(user_email.id);
|
||||
|
@ -34,7 +34,6 @@ pub async fn get(
|
||||
cookie_jar: CookieJar,
|
||||
PreferredLanguage(locale): PreferredLanguage,
|
||||
) -> Result<impl IntoResponse, FancyError> {
|
||||
tracing::info!("{locale}");
|
||||
let (csrf_token, cookie_jar) = cookie_jar.csrf_token(&clock, &mut rng);
|
||||
let (session_info, cookie_jar) = cookie_jar.session_info();
|
||||
let session = session_info.load_session(&mut repo).await?;
|
||||
@ -52,7 +51,5 @@ pub async fn get(
|
||||
|
||||
let content = templates.render_index(&ctx)?;
|
||||
|
||||
tracing::info!("rendered index page");
|
||||
|
||||
Ok((cookie_jar, Html(content)))
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ pub(crate) async fn post(
|
||||
.await?;
|
||||
|
||||
repo.job()
|
||||
.schedule_job(VerifyEmailJob::new(&user_email))
|
||||
.schedule_job(VerifyEmailJob::new(&user_email).with_language(locale.to_string()))
|
||||
.await?;
|
||||
|
||||
repo.job()
|
||||
|
Reference in New Issue
Block a user