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

Better authentication #177

Merged
merged 31 commits into from
Dec 25, 2022
Merged

Better authentication #177

merged 31 commits into from
Dec 25, 2022

Conversation

tycrek
Copy link
Owner

@tycrek tycrek commented Nov 30, 2022

⚠️ Stop! Breaking changes ahead ⚠️

This PR introduces potentially breaking changes. It is still very early in development and should only be used experimentally at this time. If you do want to give it a shot, do it in dev. If you do it in prod, backup your auth.json and data.json before switching over.

Checklist

  • I have read the Contributing Guidelines
  • I acknowledge that any submitted code will be licensed under the ISC License
  • I confirm that submitted code is my own work
  • I have tested the code, and confirm that it works

Enviroment

  • Operating System: Win 10
  • Node version: 16.14.0
  • npm version: 8.17.0

Description

This PR will hopefully tackle a couple issues. Whatever I get around to dealing with I'll detail below.

Better authentication

First on the list of things I need to overhaul: better auth. The current system is pretty simple and hard to build on. The new system will use modern functions and allow better integration with CLI tools, a future API, and frontends (via aforementioned API).

Completed task: format migration

There is still a lot of work to be done, but the main thing I wanted to get out of the way is complete! Upon startup, ass will automatically migrate the auth file format. It will generate a unique ID using Nano ID. Currently, it only generates a password hash for the admin user.

Admin user??

The admin user is set by default during auth migration. It is simply user 0, aka the first one generated when you originally installed ass. Frontends will be able to use the admin user for management without needing to configure their own user system.

Passwords?!

ass now supports password hashing with bcrypt. As mentioned above, the admin password will be randomly generated, so you'll have to set it on the command line with npm run cli-setpassword ass <password here> (replace ass if you changed the default username).

Eventually there will be a proper API for frontends to easily let their users set passwords.

Supporting Issues

Merging this PR will close #133.

@tycrek tycrek added the enhancement New feature or request label Nov 30, 2022
@tycrek tycrek added this to the 0.14.0 milestone Nov 30, 2022
@tycrek tycrek self-assigned this Nov 30, 2022
@tycrek tycrek changed the title build: added nanoid package Better authentication Nov 30, 2022
@tycrek tycrek linked an issue Nov 30, 2022 that may be closed by this pull request
@tycrek tycrek marked this pull request as ready for review December 7, 2022 22:00
@tycrek tycrek merged commit 9b0c726 into 0.14.0/stage Dec 25, 2022
@tycrek tycrek deleted the 0.14.0/better-auth branch December 25, 2022 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Proper multi-user support
1 participant