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
Copy file name to clipboardExpand all lines: blog/refine-dev-backend/index.md
+4-46Lines changed: 4 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ image: ./cover.png
13
13
14
14
[Refine.dev](https://refine.dev/) is a very powerful and popular React-based framework for building web apps with less code. It focuses on providing high-level components and hooks to cover common use cases like authentication, authorization, and CRUD. One of the main reasons for its popularity is that it allows easy integration with many different kinds of backend systems via a flexible adapter design.
15
15
16
-
This post will focus on the most important type of integration: database CRUD. I'll show how easy it is, with the help of Prisma and ZenStack, to turn your database schema into a fully secured API that powers your refine app.
16
+
This post will focus on the most important type of integration: database CRUD. I'll show how easy it is, with the help of Prisma and ZenStack, to turn your database schema into a fully secured API that powers your refine app. You'll see how we start by defining the data schema and access policies, derive an automatic CRUD API from it, and finally integrate with the Refine app via a "Data Provider."
17
17
18
18
<!-- truncate -->
19
19
@@ -106,51 +106,9 @@ The `Account`, `Session`, and `VerificationToken` models are [required by Auth.j
106
106
107
107
### Building authentication
108
108
109
-
The focus of this post will be data access and access control. However, they are only possible with an authentication component in place. We'll use simple credential-based authentication in this app. Setting it up involves three parts:
110
-
111
-
1. Configuring an Auth.js provider to verify the user's credentials.
Refine's auth provider allows you to integrate any custom authentication. You'llneedtoprovidetheimplementationforroutineslike`register`, `login`, `logout`, etc. Thecompletedcodecanbefound [here](https://github.com/ymc9/refine-nextjs-zenstack/tree/main/src/providers/auth-provider).
The focus of this post will be data access and access control. However, they are only possible with an authentication system in place. We'll use simple credential-based authentication in this app. The implementation involves creating an Auth.js configuration, installing an API route to handle auth requests, and implementing a Refine "Authentication Provider".
110
+
111
+
I won't elaborate on the details of this part, but you can find the completed code [here](https://github.com/ymc9/refine-nextjs-zenstack/tree/main/src/providers/auth-provider). It should get the registration, login, and session management parts working.
0 commit comments