Proca.Users.UserToken (proca v3.0.2)

Link to this section Summary

Functions

Builds a token with a hashed counter part.

Generates a token that will be stored in a signed place, such as session or cookie. As they are signed, those tokens do not need to be hashed.

Returns the given token with the given context.

Gets all tokens for the given user for the given contexts.

Checks if the token is valid and returns its underlying lookup query.

Checks if the token is valid and returns its underlying lookup query.

Checks if the token is valid and returns its underlying lookup query.

Link to this section Functions

Link to this function

build_email_token(user, context)

Builds a token with a hashed counter part.

The non-hashed token is sent to the user email while the hashed part is stored in the database, to avoid reconstruction. The token is valid for a week as long as users don't change their email.

Link to this function

build_session_token(user)

Generates a token that will be stored in a signed place, such as session or cookie. As they are signed, those tokens do not need to be hashed.

Link to this function

token_and_context_query(token, context)

Returns the given token with the given context.

Link to this function

user_and_contexts_query(user, contexts)

Gets all tokens for the given user for the given contexts.

Link to this function

verify_change_email_token_query(token, context)

Checks if the token is valid and returns its underlying lookup query.

The query returns the user token record.

Link to this function

verify_email_token_query(token, context)

Checks if the token is valid and returns its underlying lookup query.

The query returns the user found by the token.

Link to this function

verify_session_token_query(token)

Checks if the token is valid and returns its underlying lookup query.

The query returns the user found by the token.