{
    "description": "Entity returned after successfully authenticating.",
    "properties": {
        "expires": {
            "description": "Expiration time of the token.",
            "type": "string"
        },
        "token": {
            "description": "A *JSON Web Token* that is valid for 15 minutes.",
            "type": "string"
        },
        "user": {
            "description": "The user profile of the authenticated user.",
            "properties": {
                "_id": {
                    "description": "Unique identifier for a user.",
                    "pattern": "^[a-z0-9_-]{7,}$",
                    "readOnly": true,
                    "type": "string"
                },
                "_plan": {
                    "description": "The user's current subscription plan.",
                    "type": "string"
                },
                "created_at": {
                    "description": "Timestamp when the user was created.",
                    "readOnly": true,
                    "type": "string"
                },
                "email": {
                    "description": "The email address of the user",
                    "format": "email",
                    "type": "string",
                    "unique": true
                },
                "gravatar_id": {
                    "description": "Gravatar ID, see [documentation](https://en.gravatar.com/site/implement/).",
                    "pattern": "^[a-f0-9]{32}$",
                    "readOnly": true,
                    "type": "string"
                },
                "is_active": {
                    "description": "Whether the user is able to login. Set to `false` to ban a user.",
                    "type": "boolean"
                },
                "name": {
                    "description": "Display name, initially set to user name.",
                    "maxLength": 30,
                    "minLength": 3,
                    "type": "string"
                },
                "permissions": {
                    "description": "Set of permissions for that user, see [permission](/api/permissions).",
                    "readOnly": true,
                    "type": "object"
                },
                "provider": {
                    "description": "How the user is authenticated. For local accounts this is set to `local`, otherwise to the name of the OAuth2 provider.",
                    "enum": [
                        "local",
                        "github"
                    ],
                    "readOnly": true,
                    "type": "string"
                },
                "roles": {
                    "description": "List of roles the user belongs to.",
                    "enum": [
                        "root",
                        "admin",
                        "contributor",
                        "member"
                    ],
                    "type": "array"
                },
                "username": {
                    "description": "Username used when locally logging in.",
                    "maxLength": 30,
                    "minLength": 3,
                    "type": "string",
                    "unique": true
                }
            },
            "title": "User Profile",
            "type": "object"
        }
    },
    "required": [
        "username",
        "password"
    ],
    "title": "Authentication Response",
    "type": "object"
}