Server side rendering is great for SEO and site performance. NextJS is an amazing tool that makes using SSR easy. This blog should explain the process of authenticating the user during SSR.
Another approach when designing a database for user authentication is to store user passwords in a separate SQL table and thus make the chance of accidentally exposing the password minimal