پرش به محتویات

نشست‌ها

وارد کردن یک شخص، و آنچه پروژه درباره‌ی هر نفر می‌گوید - طول نشستش، claimهایش، و اینکه هنوز می‌تواند وارد بماند یا نه.

از خود کد خوانده می‌شود، پس هیچ‌وقت از آن عقب نمی‌ماند. توضیح‌ها مال خود کد هستند، به انگلیسی.

start_session

start_session(response: ResponseT, person: Any, *, request: HttpRequest | None = None) -> ResponseT

Sign person in on response: a new pair, in both cookies.

request, when given, travels with session_started.

issue_tokens

issue_tokens(person: Any, *, request: HttpRequest | None = None) -> Tokens

Sign person in for a native client: a new pair, and nothing set.

request, when given, travels with session_started.

Tokens dataclass

Tokens(access: str, refresh: str, lifetime: timedelta)

A pair for one person, and how long their session lasts.

mint

mint(person: Any) -> Tokens

A new pair for person, with their claims and their lifetime - and no signal.

lifetime_for

lifetime_for(person: Any) -> timedelta

How long a session of person's lasts - the project's answer, or simplejwt's.

add_claims

add_claims(token: Token, person: Any) -> None

Put the project's claims about person on token.

may_sign_in

may_sign_in(person: Any) -> bool

Whether person may still hold a session: active, and whatever the project adds.

person_of

person_of(refresh: RefreshToken) -> Any

The person refresh was issued to, or None when there is nobody.