-
No Login provider configured. Please contact your administrator.
-
-)}
diff --git a/packages/studiocms_auth/src/routes/login.astro b/packages/studiocms_auth/src/routes/login.astro
new file mode 100644
index 000000000..dee096fe7
--- /dev/null
+++ b/packages/studiocms_auth/src/routes/login.astro
@@ -0,0 +1,75 @@
+---
+import { getUserData } from 'studiocms:auth/lib/user';
+import { authEnvCheck } from 'studiocms:auth/utils/authEnvCheck';
+import { StudioCMSRoutes } from 'studiocms:helpers/routemap';
+import Config from 'virtual:studiocms/config';
+import { Button, Input } from '@studiocms/ui/components';
+import AuthLayout from '../layouts/AuthLayout.astro';
+import { hashPassword } from '../lib/password';
+
+const {
+ dashboardConfig: {
+ AuthConfig: {
+ providers,
+ providers: {
+ usernameAndPassword,
+ usernameAndPasswordConfig: { allowUserRegistration },
+ },
+ },
+ },
+} = Config;
+
+const {
+ authLinks: { loginAPI, signupURL },
+ mainLinks: { dashboardIndex },
+} = StudioCMSRoutes;
+
+const { SHOW_OAUTH } = await authEnvCheck(providers);
+
+let paragraph: string;
+
+if (usernameAndPassword && SHOW_OAUTH) {
+ paragraph = 'Enter your username & password or log in using one of the options below.';
+} else if (usernameAndPassword && !SHOW_OAUTH) {
+ paragraph = 'Enter your username & password.';
+} else if (!usernameAndPassword && SHOW_OAUTH) {
+ paragraph = 'Log in using one of the options below.';
+} else {
+ paragraph = 'No Login provider configured. Please contact your administrator.';
+}
+
+const user = await getUserData(Astro);
+
+if (user.isLoggedIn) {
+ return Astro.redirect(dashboardIndex);
+}
+---
+