Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@auth/core options assertion error #6080

Closed
Pelps12 opened this issue Dec 15, 2022 · 1 comment
Closed

@auth/core options assertion error #6080

Pelps12 opened this issue Dec 15, 2022 · 1 comment
Labels
question Ask how to do something or how something works

Comments

@Pelps12
Copy link

Pelps12 commented Dec 15, 2022

Question 💬

I'm using @auth/core in cloudflare workers so I'm putting the secret in the authOptions. However, assert config, it fails. console logging the options in @auth/core/lib/assert.js. I get options as

{
  adapter: {
    createUser: [AsyncFunction: createUser],
    getUser: [AsyncFunction: getUser],
    getUserByEmail: [AsyncFunction: getUserByEmail],
    getUserByAccount: [AsyncFunction: getUserByAccount],
    updateUser: [AsyncFunction: updateUser],
    deleteUser: [AsyncFunction: deleteUser],
    linkAccount: [AsyncFunction: linkAccount],
    unlinkAccount: [AsyncFunction: unlinkAccount],
    createSession: [AsyncFunction: createSession],
    getSessionAndUser: [AsyncFunction: getSessionAndUser],
    updateSession: [AsyncFunction: updateSession],
    deleteSession: [AsyncFunction: deleteSession]
  },
  providers: [
    {
      id: 'google',
      name: 'Google',
      type: 'oidc',
      issuer: 'https://accounts.google.com',
      style: [Object],
      options: [Object]
    }
  ],
  trustHost: true
}

But my authOptions looks like this

const db = new Kysely<Database>({
		dialect: new D1Dialect({
			database: env.DB
		})
	})

	const authOptions: AuthOptions = {
		debug: true,
		callbacks:{
			signIn({user}){
				return true;
			}
		},
		adapter: KyselyAdapter(db), 	
		providers: [
			Google({
				clientId: "dsadasdas",
				clientSecret: "adadas"
			})
		],
		secret: "", #Contains the real secret
		trustHost: true,
	}

(Don't worry. I never deploy with the same secrets)
However, when I push it, both debug and the secret disappear from the repository

How to reproduce ☕️

https://stackblitz.com/edit/github-ndr9wo?file=package.json,src%2Findex.ts

Contributing 🙌🏽

Yes, I am willing to help answer this question in a PR

@Pelps12 Pelps12 added the question Ask how to do something or how something works label Dec 15, 2022
@Pelps12
Copy link
Author

Pelps12 commented Dec 15, 2022

I had two functions but I forgot to make my changes to the second one and was calling the second one instead. Apologies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Ask how to do something or how something works
Projects
None yet
Development

No branches or pull requests

1 participant