luckyframework / luckyframework/website
Document how to use UUID with Auth better
Nobody has claimed this yet.
- Dominant language
- Crystal
- Stars
- 39
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
If you generate Auth in your API app, you'll get an UserToken class that assumes you have a User model that uses Int64 for your primary key. If you decide to use UUID, you'll need to make a few changes.
- Update migration to set primary key to UUID
- Add default_columns macro to base_model with UUID primary key
- Change return type on
decode_user_idmethod inUserTokenclass toUUID - Change the return value from
payload["user_id"].to_s.to_i64toUUID.new(payload["user_id"].to_s)
I think this is all you need to do, but we should have a section somewhere on the site that documents this.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the website's existing Auth or API-app documentation and the UserToken section. Review how decode_user_id and UUID-based models are currently described, then add a dedicated section covering the migration, default_columns, and UUID return-value changes. Done means a newcomer can follow the section to configure Auth with UUID primary keys.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal
- Domain
- authentication, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100