Skip to content

struct

Session

pub struct Session {
    pub access_token: String,
    pub refresh_token: String,
    pub expires_in: f64,
    pub user_id: String,
    pub email: String,
}

A signed-in session.

Fields

access_token

pub access_token: String

The token to send as Authorization: Bearer ….

refresh_token

pub refresh_token: String

The token that gets a new session when this one expires.

expires_in

pub expires_in: f64

Seconds until the access token expires.

user_id

pub user_id: String

The signed-in user's id.

email

pub email: String

The signed-in user's email address.

Methods

parse

pub fn parse(res: &Response) -> Result<Session, Error>

The session an auth response holds.

Trait implementations