Skip to content

ACC · Profiles, passwords and sessions

A person signs in as a login with a profile. This page holds the profile, the password rules, how long a session lasts, and the changes to a user's access that end their sessions (D37, D48). Part of Access, code ACC.

R-ACC-08 · A change to a user's roles or overrides ends all of that user's sessions and records when

Section titled “R-ACC-08 · A change to a user's roles or overrides ends all of that user's sessions and records when”
  • Status: built
  • Example: given Deka is signed in as checker, when an admin removes the role, then Deka's sessions are ended and their profile records the time; a change to your own roles signs you out too: a super_admin at PML who grants themselves finance at PML through grant_role() (R-ACC-108) lands on /login at their next request (R-ACC-48).
  • Refusal: none.
  • Who: every member whose roles or overrides change, the person making the change included: through grant_role() and revoke_role() (R-ACC-108, R-ACC-109), and set_override() and clear_override() (R-ACC-125, R-ACC-128). A change to a member's rental companies ends none (R-ACC-140). The super_admin grant at a new pool (R-ACC-47) is the one exception, R-ACC-55. A suspended or removed membership and a change to a role's permissions end sessions too: R-ACC-52 to R-ACC-54 (D48).
  • Source: D37; #144 (R-ACC-08: must trigger logout). That permissions still come from the database, not the token, is R-ACC-49.

R-ACC-13 · Every new login gets a profile, created by the database

Section titled “R-ACC-13 · Every new login gets a profile, created by the database”
  • Status: built
  • Example: given an admin invites rina@example.test, when the login is created, then a profiles row with the same id exists.
  • Refusal: none.
  • Who: every login.
  • Source: [Ref] Data model V13: profiles ↔ auth.users.

R-ACC-15 · A user can always read their own profile

Section titled “R-ACC-15 · A user can always read their own profile”
  • Status: built
  • Example: given a satpam without user:read, when they read profiles, then their own profile comes back.
  • Refusal: none.
  • Who: every signed-in user.
  • Source: [Ref] Roles, policy matrix.

R-ACC-30 · A profile's locale defaults to id (Indonesian)

Section titled “R-ACC-30 · A profile's locale defaults to id (Indonesian)”
  • Status: built
  • Example: given a new login, when its profile is read, then locale is id.
  • Refusal: none.
  • Who: every profile.
  • Source: D7; D29; [Runbook] v2 backend, M0 Interface (FE-R5).

R-ACC-31 · set_my_locale() changes only the caller's own locale

Section titled “R-ACC-31 · set_my_locale() changes only the caller's own locale”
  • Status: built
  • Example: given Deka, when they call set_my_locale('en'), then their profile's locale is en and no other profile changes. The function takes no profile argument.
  • Refusal: none.
  • Who: every signed-in user, whatever their roles.
  • Source: [Runbook] v2 backend, M0 Interface (FE-R5).

R-ACC-32 · set_my_locale() refuses any locale other than id or en

Section titled “R-ACC-32 · set_my_locale() refuses any locale other than id or en”
  • Status: built
  • Example: given Deka, when they call set_my_locale('fr'), then it is refused with the detail {"locale": "fr"} and their locale stays as it was.
  • Refusal: profile.locale_unsupported
  • Who: every signed-in user.
  • Source: [Runbook] v2 backend, M0 Interface (FE-R5); D7.

R-ACC-284 · set_my_full_name() changes only the caller's own name

Section titled “R-ACC-284 · set_my_full_name() changes only the caller's own name”
  • Status: built
  • Example: given Deka, when they call set_my_full_name('Deka Pratama'), then their profile's full_name is Deka Pratama, trimmed of spaces at either end, and no other profile changes. The function takes no profile argument.
  • Refusal: profile.not_signed_in (42501) when no one is signed in; the others are R-ACC-285's. Saving the name already held writes nothing and returns it.
  • Who: every signed-in user, whatever their roles, from /profile (R-APP-33).
  • Source: zuki, 2026-11-19, in the session on #693 (#685: a display name on /profile, through a be RPC).

R-ACC-285 · set_my_full_name() refuses a name that is blank once trimmed or longer than 100 characters

Section titled “R-ACC-285 · set_my_full_name() refuses a name that is blank once trimmed or longer than 100 characters”
  • Status: built
  • Example: given Deka, when they call set_my_full_name(' '), then it is refused with profile.name_required and their name stays as it was; a name of 101 characters is refused with profile.name_too_long and the detail {"max": 100}; one of 100 characters is saved.
  • Refusal: profile.name_required, with no detail; profile.name_too_long, with the detail {"max": 100}.
  • Who: every signed-in user.
  • Source: the lead in the session on #693 (the keys and the 100-character bound, be's proposal); D10.

R-ACC-48 · A request with a login token issued before the user's last access change is refused, and the user is sent to sign in again

Section titled “R-ACC-48 · A request with a login token issued before the user's last access change is refused, and the user is sent to sign in again”
  • Status: planned
  • Example: given Deka's roles changed at 10:00, when they load a page at 10:01 with a token issued at 09:30, then session_is_current() says no and they land on /login; after signing in again their requests go through. A token's issue time is in whole seconds, so a token issued in the same second as the change counts as older: with the change at 10:00:00.4, a token issued at 10:00:00 is refused, and one issued at 10:00:01 goes through.
  • Refusal: none: proxy.ts sends the user to /login. An error from session_is_current() counts as not current.
  • Who: every signed-in user, on every request (proxy.ts in apps/web).
  • Source: D37; #144.

R-ACC-52 · Suspending a membership ends all of that member's sessions and records when

Section titled “R-ACC-52 · Suspending a membership ends all of that member's sessions and records when”
  • Status: built
  • Example: given Deka is signed in as checker at PML, when a super_admin suspends Deka through suspend_member() (R-ACC-187), then Deka's sessions are ended and their profile records the time; their next request lands on /login (R-ACC-48), and they hold nothing once signed in again (R-ACC-07).
  • Refusal: none.
  • Who: every member whose membership is suspended. Reinstating a membership ends nothing (R-ACC-188).
  • Source: D48 (a membership suspended); #154. Built in BE pack G1b (#165) by a trigger on memberships, the same mechanism as R-ACC-08, so it holds for any writer; app users suspend only through suspend_member() since M1-04 (#457).

R-ACC-53 · Removing a membership ends all of that person's sessions and records when

Section titled “R-ACC-53 · Removing a membership ends all of that person's sessions and records when”
  • Status: built
  • Example: given Rina works for organizations A and B and is signed in, when A's super_admin removes Rina's membership in A through remove_member() (R-ACC-189), then Rina's sessions are ended and their profile records the time; they sign in again and still work in B.
  • Refusal: none.
  • Who: every person whose membership is deleted, by remove_member() or by the operator; R-ACC-37 says who may call remove_member().
  • Source: D48 (a membership removed); #154. Built in BE pack G1b (#165).

R-ACC-54 · Adding a permission to a role or removing one ends the sessions of every member who holds that role, and records when

Section titled “R-ACC-54 · Adding a permission to a role or removing one ends the sessions of every member who holds that role, and records when”
  • Status: built
  • Example: given Deka and Rina hold the organization's role "kasir" at PML and SBY, when a super_admin adds payment:approve to kasir, then both their sessions are ended and both profiles record the time; members without kasir keep theirs.
  • Refusal: none.
  • Who: every member holding the role, at any pool. In the app only an organization's own roles can change (R-ACC-20, R-ACC-21); a migration that changes a system role's permissions signs out its holders too.
  • Source: D48 (a role's permissions change); #154. Built in BE pack G1b (#165) by a trigger on role_permissions.

R-ACC-55 · The super_admin grant at a new pool (R-ACC-47) ends no sessions

Section titled “R-ACC-55 · The super_admin grant at a new pool (R-ACC-47) ends no sessions”
  • Status: built
  • Example: given Rina is the organization's super_admin and is signed in, when pool SBY is created and they are granted super_admin there, then their sessions go on and their profile's time of last access change stays as it was.
  • Refusal: none.
  • Who: every super_admin granted a pool by R-ACC-47. Any other change to their roles still ends their sessions (R-ACC-08).
  • Source: D48: the grant only adds access, the system makes it, and permissions are never read from the token (R-ACC-49). Built in BE pack G1b (#165); as G1 built it, creating a pool signs every super_admin out.

R-ACC-56 · Nobody can sign up: a login is never made without an invitation

Section titled “R-ACC-56 · Nobody can sign up: a login is never made without an invitation”
  • Status: built
  • Example: given the sign-up endpoint of any environment, when a visitor posts an email and a password with the publishable key, then it is refused and no login is made; /login offers no sign-up link.
  • Refusal: none: Supabase Auth refuses it, as sign-up is off in config.toml and in each hosted project.
  • Who: every visitor, on every environment. Checked by tools/db/check-auth-config.mjs against config.toml, and proved by a Playwright journey in apps/web/e2e/invitations.spec.ts, not pgTAP: Auth is outside Postgres.
  • Source: D50 (OQ2: "start with invitation, no sign-up allowed").

R-ACC-60 · A password has 8 to 15 characters

Section titled “R-ACC-60 · A password has 8 to 15 characters”
  • Status: built
  • Example: given a member accepting an invitation or resetting a password, when the new password is "Abcdef1" (7 characters) or "Abcdefghijklmn12" (16), then it is refused; "Abcdefg1" (8) and "Abcdefghijklm12" (15) are accepted.
  • Refusal: none: under 8, Supabase Auth refuses it with its weak_password code; over 15, apps/web's form refuses it before calling Auth, since Auth has no maximum.
  • Who: every password set in the app. A password set outside the app could be longer; staff have no such path. The lower bound is checked by tools/db/check-auth-config.mjs against config.toml; both bounds are proved by a Playwright journey in apps/web/e2e/invitations.spec.ts, not pgTAP.
  • Source: D51 (OQ12).

R-ACC-61 · A password has at least one uppercase letter and one digit

Section titled “R-ACC-61 · A password has at least one uppercase letter and one digit”
  • Status: retired (replaced by R-ACC-70, which also requires a lowercase letter)
  • Example: given a member setting a password, when it is "abcdefg1" (no uppercase) or "Abcdefgh" (no digit), then it is refused; "Abcdefg1" is accepted.
  • Refusal: none: Supabase Auth's weak_password code. Auth's setting that requires both, "lowercase, uppercase letters and digits", also requires a lowercase letter (D51's consequences), so "ABCDEFG1" is refused too.
  • Who: every password set in the app; config.toml sets the same requirement locally, so the local stack and CI behave as hosted.
  • Source: D51 (OQ12). Retired before it was built: zuki on #180 added the lowercase letter (R-ACC-70).

R-ACC-62 · A session lasts at most 24 hours, then the user signs in again

Section titled “R-ACC-62 · A session lasts at most 24 hours, then the user signs in again”
  • Status: planned
  • Example: given Deka signed in at 08:00 on Monday, when they open a page at 08:01 on Tuesday, then they land on /login, however active they were in between.
  • Refusal: none: Supabase Auth's session time-box ends the session; proxy.ts finds no session (R-APP-01).
  • Who: every login. The time-box is a paid Supabase setting: production has it, staging only if it moves to a paid plan; config.toml sets it locally. Checked by tools/db/check-auth-config.mjs against config.toml; no pgTAP or Playwright test can wait 24 hours, so it stays planned.
  • Source: D51 (OQ12).

R-ACC-70 · A password has at least one lowercase letter, one uppercase letter and one digit

Section titled “R-ACC-70 · A password has at least one lowercase letter, one uppercase letter and one digit”
  • Status: built
  • Example: given a member setting a password, when it is "ABCDEFG1" (no lowercase), "abcdefg1" (no uppercase) or "Abcdefgh" (no digit), then it is refused; "Abcdefg1" is accepted. Its length is R-ACC-60.
  • Refusal: none: Supabase Auth's weak_password code, from its setting "lowercase, uppercase letters and digits".
  • Who: every password set in the app; config.toml sets the same requirement locally, so the local stack and CI behave as hosted. A password moved from v1 keeps working until it is next set (R-ACC-59). Checked by tools/db/check-auth-config.mjs against config.toml, and proved by a Playwright journey in apps/web/e2e/invitations.spec.ts, not pgTAP.
  • Source: D51 (OQ12); zuki on #180 (2026-10-20: lowercase too), #210. Replaces R-ACC-61.

R-ACC-246 · Changing a password needs a recent sign-in

Section titled “R-ACC-246 · Changing a password needs a recent sign-in”
  • Status: planned
  • Example: given Deka's session began more than 24 hours ago, when it asks Supabase Auth to change their password, then it is refused and the password stays; Deka's session that began a minute ago, from an invite link (R-ACC-100) or a password-reset link, changes it.
  • Refusal: none: Supabase Auth's reauthentication_needed code, from secure_password_change in config.toml and in each hosted project.
  • Who: every login, on every path that sets a password through Auth. A session lasts at most 24 hours (R-ACC-62), so where the time-box is on, Auth almost never asks; it holds where it is off. Outside /welcome, /profile changes a password and asks for Auth's emailed code when Auth answers reauthentication_needed (R-APP-34, R-APP-35). Checked by tools/db/check-auth-config.mjs against config.toml; no journey can make a session 24 hours old, so it stays planned.
  • Source: zuki in the session on #637 (secure_password_change on), from #603; D51.