Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a00cf2b
DB migratinos `tos` table
sebadob Oct 13, 2025
6602ac8
`ToS` CRUD
sebadob Oct 13, 2025
2417555
API endpoints
sebadob Oct 13, 2025
53cff6e
fix "fetch latest tos" DB query
sebadob Oct 14, 2025
2115889
clear all caches on startup if in debug mode
sebadob Oct 14, 2025
439356c
first version of a basic frontend in Admin UI to be able to add new ToS
sebadob Oct 14, 2025
074888c
show and handle ToS during open registration
sebadob Oct 15, 2025
ba91870
small UX improvements during register with ToS
sebadob Oct 15, 2025
25f90ad
add `tos_user_accept` table to DB migrations
sebadob Oct 16, 2025
b93ca00
add `ToSUserAccept` to be able to accept a ToS
sebadob Oct 16, 2025
ff22d57
add entry into `tos_user_accept` after registration via open endpoint
sebadob Oct 16, 2025
0aa3863
API endpoint to retrieve ToS accept status for a user
sebadob Oct 16, 2025
77770a3
first UI template for fetching User ToS Accept Status
sebadob Oct 16, 2025
b7e38cb
note down possible locations and ways in the code how / where to acce…
sebadob Oct 20, 2025
e64e34b
create a new `AuthCodeToSAwait` to provide best possible UX
sebadob Oct 22, 2025
d1eab8f
extract `fn` for `User::needs_tos_update()`
sebadob Oct 27, 2025
e8fec06
add new `[tos]` section to `config.toml`
sebadob Oct 27, 2025
0118457
develop a template for a cleaner approach to ToS accept during login …
sebadob Oct 27, 2025
56bc40e
new approach after Webauthn auth finish (not finished)
sebadob Oct 27, 2025
684e893
rework accept logic during logins and start integrating into UI
sebadob Nov 3, 2025
bfb776f
return `HTTP 206` if ToS were updated and extract body in UI
sebadob Nov 3, 2025
e16e310
fetch and show latest ToS if update is necessary during login
sebadob Nov 3, 2025
0859139
handle updated ToS accept in UI
sebadob Nov 3, 2025
339e052
accepting updates ToS during login flow working for password accounts
sebadob Nov 4, 2025
ce90d04
prepare webauthn integration
sebadob Nov 11, 2025
f07e6db
Merge remote-tracking branch 'origin/main' into 1196-tos
sebadob Nov 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2068,6 +2068,29 @@ key_path = 'tls/key.pem'
# overwritten by: TLS_GENERATE_SELF_SIGNED
generate_self_signed = true

[tos]

# The timeout in seconds for a user to accept update ToS during the
# login flow.
# The initial lifetime of an AuthCode after a successful authentication
# will be extended by the `accept_timeout`. This gives the user a bit
# more time to read through updates ToS and avoids an AuthCode expiry
# if it takes a bit longer. This is mainly a UX improvement. After the
# ToS have been accepted, the original AuthCode will be re-saved with
# the actual lifetime to not weaken the security in these cases.
#
# CAUTION: Even though you can extend the lifetime on Rauthys side, you
# can run into issues with logins on the client side. For legal reasons,
# accepting updated ToS must happen after a successful login but before
# providing any access. Login flows are not only time-limited on Rauthys
# side, but most often also on the client side. This means if it takes
# too long to read and accept update ToS, the user may run into an auth
# error and do the login again.
#
# default: 900
# overwritten by: TOS_ACCEPT_TIMEOUT
accept_timeout = 900

[user_pictures]
# The storage type for user pictures.
# By default, they are saved inside the Database, which is not ideal.
Expand Down
6 changes: 6 additions & 0 deletions dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## CURRENT WORK

ToS TODO

- handle updates during immediate login refresh
- handle updates during AuthProvider logins
- find a clean way to handle updates during Webauthn logins

## Stage 1 - essentials

[x] finished
Expand Down
35 changes: 35 additions & 0 deletions frontend/src/api/types/tos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export interface ToSRequest {
is_html: boolean;
content: string;
}

export interface ToSUserAcceptRequest {
tos_ts: number;
// 65 char code
accept_code: string;
}

export interface ToSResponse {
ts: number;
author: string;
is_html: boolean;
content: string;
}

export interface ToSAwaitLoginResponse {
code: string;
user_id: string;
}

export interface ToSLatestResponse {
ts: number;
is_html: boolean;
content: string;
}

export interface ToSUserAcceptResponse {
user_id: string;
tos_ts: number;
accept_ts: number;
location: string;
}
18 changes: 9 additions & 9 deletions frontend/src/api/types/webauthn.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export interface PasskeyResponse {
name: string,
/// Unix timestamp in seconds
registered: number,
/// Unix timestamp in seconds
last_used: number,
user_verified?: boolean,
name: string;
/// Unix timestamp in seconds
registered: number;
/// Unix timestamp in seconds
last_used: number;
user_verified?: boolean;
}

export interface WebauthnDeleteRequest {
/// 32 chars long MfaModToken.id
mfa_mod_token_id?: string,
}
/// 32 chars long MfaModToken.id
mfa_mod_token_id?: string;
}
671 changes: 343 additions & 328 deletions frontend/src/i18n/admin/de.ts

Large diffs are not rendered by default.

664 changes: 337 additions & 327 deletions frontend/src/i18n/admin/en.ts

Large diffs are not rendered by default.

Loading