Automatic ChatGPTs login page refresher

Automatically refresh the page until the "Log in" button appears

// ==UserScript==
// @name         Automatic ChatGPTs login page refresher
// @name:ru      Автоматическое обновление страницы входа ChatGPT
// @namespace    https://chat.openai.com/
// @version      0.1
// @description  Automatically refresh the page until the "Log in" button appears
// @description:ru  Автоматически обновляет страницу до тех пор, пока не появится кнопка "Login".
// @author       fedyacpp
// @match        https://chat.openai.com/auth/login
// @icon         https://www.google.com/s2/favicons?sz=64&domain=openai.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    var loginButton = document.querySelector('button.btn.flex.justify-center.gap-2.btn-primary');

    function refreshPage() {
        if (!loginButton) {
            location.reload();
        }
    }

    setInterval(refreshPage, 400);
})();