I have a Svelte web app exclusively for internal use, so there is no main landing page or registration, as accounts need to be created by the admin. Since the main page has no function as an unauthenticated user, it will redirect to the login page. After a successful login, there is a JS redirect back to the home page, where there will be useful information specific to the account.
Are there any implications to using throw redirect(302, '/login')
vs something like if (!user) { document.location = '/login' }
? I would guess that the HTTP redirect would be insignificantly faster, but am unsure if there are any side effects from using the temporary 300 codes which the browser would have to handle.
I tried looking up some general rules of thumb for when to use each type, but they usually addressed things like SEO optimization which is a non-concern in this case.