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
adaptersChanges related to the core code concerning database adaptersbugSomething isn't workingtriageUnseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
I was trying surrealdb adapter to login with google for my app. I followed the guide setup for oauth. When finally signed in with google i am being redirected to /api/auth/[...nextauth] error is being thrown server configuration not right.
How to reproduce
Try Surrealdb adapter setup for next js with google as provider.
import { Surreal } from "surrealdb.js";
const connectionString = process.env.NEXT_PUBLIC_DB_CONNECTION_URL as string;
const username = process.env.NEXT_PUBLIC_DB_USER as string;
const password = process.env.NEXT_PUBLIC_DB_PASSWORD as string;
const namespace = process.env.NEXT_PUBLIC_NAMESPACE as string;
const database = process.env.NEXT_PUBLIC_DB_NAME as string;
export const surrealDatabase = new Surreal();
export const surrealConnection = () =>
new Promise<Surreal>(async (resolve, reject) => {
try {
await surrealDatabase.connect(`${connectionString}/rpc`, {
namespace,
database,
auth: { username, password },
});
resolve(surrealDatabase);
} catch (e) {
console.log("here1");
console.log({ e });
reject(e);
}
});
Expected behavior
Should signin without error message.
The text was updated successfully, but these errors were encountered:
Swado
added
adapters
Changes related to the core code concerning database adapters
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
Aug 30, 2024
I believe is because Auth.js is using surrealdb.js instead of it's successor, surrealdb. The adapter should be updated to use the latest package from surreal. Did you have any success working through this @Swado?
The connection string needs to start with ws or wss and not use /rpc at the end in order to use this version of surrealdb.js package. Also the package should change from surrealdb.js to surrealdb@^1.0.0.
I believe is because Auth.js is using surrealdb.js instead of it's successor, surrealdb. The adapter should be updated to use the latest package from surreal. Did you have any success working through this @Swado?
Actually i commented the adapter field in NextAuth. I studied the adapter code it just facilitates recurring methods liking getting user data and signin details so i just wrote my own logic.🤡 @liamwh
The connection string needs to start with ws or wss and not use /rpc at the end in order to use this version of surrealdb.js package. Also the package should change from surrealdb.js to surrealdb@^1.0.0.
adaptersChanges related to the core code concerning database adaptersbugSomething isn't workingtriageUnseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Adapter type
@auth/surrealdb-adapter
Environment
Reproduction URL
https://github.com/Swado/testmyst
Describe the issue
I was trying surrealdb adapter to login with google for my app. I followed the guide setup for oauth. When finally signed in with google i am being redirected to /api/auth/[...nextauth] error is being thrown server configuration not right.
How to reproduce
Try Surrealdb adapter setup for next js with google as provider.
auth.ts
surreal.ts
Expected behavior
Should signin without error message.
The text was updated successfully, but these errors were encountered: