io.randomseed.utils.auth.locking

added in 2.0.6

Random Utilities, authentication, lock-state helpers (hard lock, soft lock, remaining wait).

*lock-wait-default*

dynamic

Default soft-lock wait duration (10 minutes). Used as fallback when auth config does not specify :locking/lock-wait.

hard-lock-time

(hard-lock-time m)

Gets hard-lock timestamp from user/auth map.

hard-locked?

(hard-locked? m)

Returns true when hard lock timestamp is present.

lock-wait

(lock-wait auth-config-or-lock-wait)

Returns lock wait duration from auth config map/record or explicit duration.

soft-lock-passed

(soft-lock-passed m now)

Returns duration passed since soft lock until now (positive only).

soft-lock-remains

(soft-lock-remains lock-passed auth-config-or-lock-wait)(soft-lock-remains m auth-config-or-lock-wait now)

Returns remaining soft-lock duration (or nil when no active soft lock).

soft-lock-time

(soft-lock-time m)

Gets soft-lock timestamp from user/auth map.

soft-locked?

(soft-locked? lock-passed auth-config-or-lock-wait)(soft-locked? m auth-config-or-lock-wait now)

Returns true when current soft-lock window has not expired.