Skip to content

Commit 2865452

Browse files
committed
chore: rename AuthBindings to AuthProvider
1 parent 48f3b9e commit 2865452

3 files changed

Lines changed: 19 additions & 26 deletions

File tree

refine-vite/plugins/auth-provider-auth0/extend.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const base = {
22
_app: {
3-
refineImports: [`Authenticated`, `AuthBindings`],
3+
refineImports: [`Authenticated`, `AuthProvider`],
44
import: [
55
`import axios from "axios";`,
66
`import { useAuth0 } from "@auth0/auth0-react";`,
@@ -15,7 +15,7 @@ const base = {
1515
return <span>loading...</span>
1616
}`,
1717
`
18-
const authProvider: AuthBindings = {
18+
const authProvider: AuthProvider = {
1919
login: async () => {
2020
return {
2121
success: true,

refine-vite/plugins/auth-provider-google/extend.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const base = {
22
_app: {
3-
refineImports: [`AuthBindings`],
3+
refineImports: [`AuthProvider`],
44
import: [`import axios from "axios";`],
55
localImport: [
66
`import { Login } from "./pages/login";`,
@@ -20,7 +20,7 @@ const base = {
2020
],
2121
inner: [
2222
`
23-
const authProvider: AuthBindings = {
23+
const authProvider: AuthProvider = {
2424
login: async ({ credential }: CredentialResponse) => {
2525
const profileObj = credential ? parseJwt(credential) : null;
2626

refine-vite/plugins/data-provider-supabase/src/authProvider.ts

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import { AuthBindings } from "@refinedev/core";
2-
1+
import { AuthProvider } from "@refinedev/core";
32
import { supabaseClient } from "./utility";
43

5-
const authProvider: AuthBindings = {
4+
const authProvider: AuthProvider = {
65
login: async ({ email, password, providerName }) => {
76
// sign in with oauth
87
try {
98
if (providerName) {
10-
const {
11-
data,
12-
error,
13-
} = await supabaseClient.auth.signInWithOAuth({
14-
provider: providerName,
15-
});
9+
const { data, error } =
10+
await supabaseClient.auth.signInWithOAuth({
11+
provider: providerName,
12+
});
1613

1714
if (error) {
1815
return {
@@ -30,13 +27,11 @@ const authProvider: AuthBindings = {
3027
}
3128

3229
// sign in with email and password
33-
const {
34-
data,
35-
error,
36-
} = await supabaseClient.auth.signInWithPassword({
37-
email,
38-
password,
39-
});
30+
const { data, error } =
31+
await supabaseClient.auth.signInWithPassword({
32+
email,
33+
password,
34+
});
4035

4136
if (error) {
4237
return {
@@ -103,12 +98,10 @@ const authProvider: AuthBindings = {
10398
},
10499
forgotPassword: async ({ email }) => {
105100
try {
106-
const {
107-
data,
108-
error,
109-
} = await supabaseClient.auth.resetPasswordForEmail(email, {
110-
redirectTo: `${window.location.origin}/update-password`,
111-
});
101+
const { data, error } =
102+
await supabaseClient.auth.resetPasswordForEmail(email, {
103+
redirectTo: `${window.location.origin}/update-password`,
104+
});
112105

113106
if (error) {
114107
return {

0 commit comments

Comments
 (0)