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

Sign in with Credentials - SvelteKit #6127

Closed
KoljaL opened this issue Dec 20, 2022 · 1 comment
Closed

Sign in with Credentials - SvelteKit #6127

KoljaL opened this issue Dec 20, 2022 · 1 comment
Labels
triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@KoljaL
Copy link

KoljaL commented Dec 20, 2022

Environment

	"devDependencies": { 
		"@sveltejs/adapter-auto": "^1.0.0",
		"@sveltejs/kit": "^1.0.0", 
                ...
	},
	"dependencies": {
		"@auth/core": "^0.1.4",
		"@auth/sveltekit": "^0.1.6",
		"@prisma/client": "^4.7.1"
	}

Reproduction URL

https://github.com/KoljaL/SK-AuthJS

Describe the issue

In my repo I use the authentication via Github and want to extend via the Credentials provider.

I added this: https://next-auth.js.org/providers/credentials#example---username--password in the hooks.server.ts

After submit I'm not logged in.
The cookies were set, but $page.data.sessionis still empty.

How to reproduce

Clone the repo and run bash resetdb.sh

Expected behavior

After the Login, I expect, that I am logged in as user J Smith.

@KoljaL KoljaL added the triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. label Dec 20, 2022
@balazsorban44
Copy link
Member

balazsorban44 commented Dec 21, 2022

On the same page in the docs you can see this:

It comes with the constraint that users authenticated in this manner are not persisted in the database, and consequently that the Credentials provider can only be used if JSON Web Tokens are enabled for sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

2 participants