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

chore: follow Lucia examples a bit more closely #123

Merged
merged 4 commits into from
Oct 15, 2024
Merged

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented Oct 14, 2024

I was having a hard time following the example in https://github.com/lucia-auth/example-sveltekit-email-password-2fa because methods were in different order and places

There's also a couple methods missing that I think we could add at some point. I filed #122 for that

Just curious if you were following a different example than I'm looking at?

I also changed the default for creating a demo to true because otherwise the auth file was just unused and it was a bit hard to see how to integrate it. I think even if I had my own login screens already I'd still want the demo as a guide

Copy link

changeset-bot bot commented Oct 14, 2024

⚠️ No Changeset found

Latest commit: 559c323

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

pkg-pr-new bot commented Oct 14, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/sveltejs/cli/sv@123

commit: 559c323

@AdrianGonz97
Copy link
Member

Just curious if you were following a different example than I'm looking at?

I mainly followed this section of the documentation: https://lucia-next.pages.dev/sessions/basic-api/drizzle-orm

I may have swapped the order of some things

@benmccann
Copy link
Member Author

Interesting. Looks like they're not consistent about the order between that guide and the examples, so I won't worry too much about the order then. I restored the old order to make the diff easier to follow. I did put export type SessionValidationResult at the bottom though as it was at the bottom in both the examples and guide you linked to

The one thing I did change was to move the generateUserId method out of auth and into the registration function. It's not really auth-related. I also updated it to generate IDs the same as nanoid to be a bit more realistic

packages/adders/lucia/index.ts Show resolved Hide resolved
packages/adders/lucia/index.ts Outdated Show resolved Hide resolved
@manuel3108 manuel3108 merged commit 39d557f into main Oct 15, 2024
5 checks passed
@manuel3108 manuel3108 deleted the lucia-guide branch October 15, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants