You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> You can take a look at all the [possible configuration options below](#configuration-options).
125
+
> You can take a look at [all the settings you can tweak below](#configuring-authproto).
127
126
128
127
# Using `@fujocoded/authproto`
129
128
129
+
## Add your login form
130
+
130
131
Add the `<Login />` component to your site, like this:
131
132
132
133
```jsx
@@ -138,14 +139,14 @@ import { Login } from "@fujocoded/authproto/components";
138
139
<Login />
139
140
```
140
141
141
-
> [!TIP]
142
-
>
143
-
> You might run into a naming collision issue if you also have a page named `login`. You can fix this by replacing `{ Login }` with `{ Login as LoginComponent }`.
144
-
145
142
It'll look like a plain form:
146
143
147
144
<!-- screenshot -->
148
145
146
+
See [Customizing the login form](#customizing-the-login-form) for ways to change how it looks and where it sends people after they log in.
147
+
148
+
## Make a page only visible to logged in users
149
+
149
150
To make a page only visible to logged in users:
150
151
151
152
```jsx
@@ -167,18 +168,31 @@ if (!loggedInUser) {
167
168
168
169
... And you've got authentication working on your Astro site!
169
170
171
+
> [!TIP]
172
+
>
173
+
> If you also have a page file named `login.astro`, you'll see the TypeScript error `Import declaration conflicts with local declaration of 'Login'` on the import line. Fix it by renaming the import:
0 commit comments