Skip to content

Commit

Permalink
fix(nextjs): auth-provider (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
alicanerdurmaz authored Dec 13, 2024
1 parent 9b1e44a commit a657832
Show file tree
Hide file tree
Showing 28 changed files with 26 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Header } from "@components/header";
import { redirect } from 'next/navigation'
<%_ } _%>
<%_ if (_app.isAuthProviderCheck) { _%>
import { authProviderServer } from '@providers/auth-provider'
import { authProviderServer } from '@providers/auth-provider/auth-provider.server'
import { redirect } from 'next/navigation'
<%_ } _%>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Header } from "@components/header";
import { redirect } from 'next/navigation'
<%_ } _%>
<%_ if (_app.isAuthProviderCheck) { _%>
import { authProviderServer } from '@providers/auth-provider'
import { authProviderServer } from '@providers/auth-provider/auth-provider.server'
import { redirect } from 'next/navigation'
<%_ } _%>

Expand Down
4 changes: 2 additions & 2 deletions refine-nextjs/plugins/auth-provider-custom/extend.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const base = {
_app: {
localImport: [
'import { authProvider } from "@providers/auth-provider";',
'import { authProviderClient } from "@providers/auth-provider/auth-provider.client";',
],
refineProps: ["authProvider={authProvider}"],
refineProps: ["authProvider={authProviderClient}"],
refineAntdImports: [],
refineMuiImports: [],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function ForgotPassword() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function Login() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function Register() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const mockUsers = [
},
];

export const authProvider: AuthProvider = {
export const authProviderClient: AuthProvider = {
login: async ({ email, username, password, remember }) => {
// Suppose we actually send a request to the back end here.
const user = mockUsers[0];
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion refine-nextjs/plugins/data-provider-appwrite/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const base = {
_app: {
import: [],
localImport: [
'import { authProviderClient } from "@providers/auth-provider";',
'import { authProviderClient } from "@providers/auth-provider/auth-provider.client";',
'import { appwriteDataProvider, appwriteLiveProvider } from "@providers/data-provider";',
],
refineProps: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function ForgotPassword() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function Login() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function Register() {
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions refine-nextjs/plugins/data-provider-strapi-v4/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ const base = {
_app: {
import: [],
localImport: [
'import { authProvider } from "@providers/auth-provider";',
'import { authProviderClient } from "@providers/auth-provider/auth-provider.client";',
'import { dataProvider } from "@providers/data-provider";',
],
refineProps: [
"authProvider={authProvider}",
"authProvider={authProviderClient}",
"dataProvider={dataProvider}",
],
refineAntdImports: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function ForgotPassword() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function Login() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function Register() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Cookies from "js-cookie";

const strapiAuthHelper = AuthHelper(API_URL + "/api");

export const authProvider: AuthProvider = {
export const authProviderClient: AuthProvider = {
login: async ({ email, password }) => {
const { data, status } = await strapiAuthHelper.login(email, password);
if (status === 200) {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion refine-nextjs/plugins/data-provider-supabase/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const base = {
_app: {
import: [],
localImport: [
'import { authProviderClient } from "@providers/auth-provider";',
'import { authProviderClient } from "@providers/auth-provider/auth-provider.client";',
'import { dataProvider } from "@providers/data-provider";',
],
refineProps: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function ForgotPassword() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function Login() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthPage } from "@components/auth-page";
import { authProviderServer } from "@providers/auth-provider";
import { authProviderServer } from "@providers/auth-provider/auth-provider.server";
import { redirect } from "next/navigation";

export default async function Register() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Layout as BaseLayout } from "@components/layout";
import { redirect } from 'next/navigation'
<%_ } _%>
<%_ if (_app.isAuthProviderCheck) { _%>
import { authProviderServer } from '@providers/auth-provider'
import { authProviderServer } from '@providers/auth-provider/auth-provider.server'
import { redirect } from 'next/navigation'
<%_ } _%>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Layout as BaseLayout } from "@components/layout";
import { redirect } from 'next/navigation'
<%_ } _%>
<%_ if (_app.isAuthProviderCheck) { _%>
import { authProviderServer } from '@providers/auth-provider'
import { authProviderServer } from '@providers/auth-provider/auth-provider.server'
import { redirect } from 'next/navigation'
<%_ } _%>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Header } from "@components/header";
import { redirect } from 'next/navigation'
<%_ } _%>
<%_ if (_app.isAuthProviderCheck) { _%>
import { authProviderServer } from '@providers/auth-provider'
import { authProviderServer } from '@providers/auth-provider/auth-provider.server'
import { redirect } from 'next/navigation'
<%_ } _%>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Header } from "@components/header";
import { redirect } from 'next/navigation'
<%_ } _%>
<%_ if (_app.isAuthProviderCheck) { _%>
import { authProviderServer } from '@providers/auth-provider'
import { authProviderServer } from '@providers/auth-provider/auth-provider.server'
import { redirect } from 'next/navigation'
<%_ } _%>

Expand Down

0 comments on commit a657832

Please sign in to comment.