suweal/auth
Types
The payload structure for JWT authentication, containing standard claims and custom fields.
pub type Payload {
Payload(
issued_at: timestamp.Timestamp,
not_valid_before: timestamp.Timestamp,
expire_at: timestamp.Timestamp,
issuer: String,
jwt_id: String,
namespace: String,
database: String,
access: String,
id: String,
)
}
Constructors
-
Payload( issued_at: timestamp.Timestamp, not_valid_before: timestamp.Timestamp, expire_at: timestamp.Timestamp, issuer: String, jwt_id: String, namespace: String, database: String, access: String, id: String, )
Values
pub fn generate_jwt(payload: Payload, key: key.Key) -> String
Generates a JWT token with the given payload and signs it using the provided key. It constructs the JWT header and payload, then signs the token to produce a JWT string.