wise-white
wise-white3mo ago

AUTH BINDING DEPRECATED?(LOGIN ISSUE)

im havinf this issue when i login ound","error":"Not Found","statusCode":404}}}],"data":null,"status":200,"headers":{}},"request":{"query":"\n mutation Login($email: String!) {\n login(loginInput: { email: $email }) {\n accessToken\n }\n }\n ","variables":
No description
3 Replies
kapa.ai
kapa.ai3mo ago
Hi @0xkenn. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the knowledge sources provided, it seems like you're having an issue with the login functionality of your application. However, there's no direct mention of AuthBindings being deprecated. In one of the Github issues (https://github.com/refinedev/refine/issues/5529), a user had a similar confusion about AuthProvider and AuthBindings. The response from the team member clarified that AuthBindings was re-exported as AuthProvider for consistency, but the documentation was released early before the actual version release. The team member suggested using AuthBindings from @refinedev/core, instead of AuthProvider for the time being. As for the login issue you're facing, it's hard to provide a specific solution without more context. However, there are several instances in the knowledge sources where users faced login issues. For example, in a Discord support thread (https://discord.com/channels/837692625737613362/1197096871387205683), a user faced an issue where the login endpoint returned a 201 response and user data, but an error was thrown stating "refine always expects a resolved promise". In another Github issue (https://github.com/refinedev/refine/issues/1527), a user reported that the default AuthHelper of @pankod/refine-strapi-v4:3.1.0 was not working as expected due to changes in the endpoints of Strapi-v4. If you're using a custom authProvider, make sure it's set up correctly. Here's an example from a Discord support thread (https://discord.com/channels/837692625737613362/1181698816630591499):
export const authProvider: AuthBindings = {
login: async ({ reference, passcode, providerName }) => {
try {
const { data } = await axiosInstance.get(
`${API_BASE_URL}/authentication/otp/verify`,
{
params: { passcode, reference },
}
);
localStorage.setItem("authToken", data.token);
export const authProvider: AuthBindings = {
login: async ({ reference, passcode, providerName }) => {
try {
const { data } = await axiosInstance.get(
`${API_BASE_URL}/authentication/otp/verify`,
{
params: { passcode, reference },
}
);
localStorage.setItem("authToken", data.token);
If you're still facing issues, it would be helpful to provide more details about your setup and the exact error message you're seeing. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@1131343663138623648> kapa.ai is still learning and improving, please let us know how it did by reacting below
wise-white
wise-white3mo ago
'AuthBindings' is deprecated.ts(6385) types.d.ts(70, 4): The declaration was marked as deprecated here. (alias) type AuthBindings = { login: (params: any) => Promise<AuthActionResponse>; logout: (params: any) => Promise<AuthActionResponse>; check: (params?: any) => Promise<...>; ... 5 more ...; getIdentity?: ((params?: any) => Promise<...>) | undefined; } import AuthBindings