<?php

// Other theme
$searchPattern = '#^https?://[^\/]*other-page#';
if (isset($this->data['SPMetadata']['metadata-index']) &&
    preg_match($searchPattern, $this->data['SPMetadata']['metadata-index'])
) {
    // Used for normal login cases
    return 'lifestyle-other-page';
}
if ($this->data['stateparams']['AuthState']) {
    parse_str(parse_url($this->data['stateparams']['AuthState'], PHP_URL_QUERY), $query);
    if (isset($query['spentityid']) && preg_match($searchPattern, $query['spentityid'])
    ) {
        // Used if redirected from mfa dialogue
        return 'lifestyle-other-page';
    }
}

// Default theme
return 'lifestyle';