This app uses Hack Club OAuth for authentication. To set it up:
- Go to https://auth.hackclub.com/ and create a new OAuth application
- Copy
.env.exampleto.envand fill in your credentials:cp .env.example .env
- Generate a lockbox master key for encrypting access tokens:
export LOCKBOX_MASTER_KEY=$(openssl rand -hex 32) echo "LOCKBOX_MASTER_KEY=$LOCKBOX_MASTER_KEY" >> .env
- Restart your Rails server
The User model includes:
hack_club_id- Unique identifier from Hack Clubdisplay_name- User's display nameemail- User's email addressaccess_token- Encrypted OAuth access tokenrole- User role (user or admin)provider- OAuth provider (hackclub)last_sign_in_at- Timestamp of last sign in
- user (0) - Regular user
- admin (1) - Administrator with elevated privileges
current_user- Returns the currently signed in useruser_signed_in?- Returns true if a user is signed inauthenticate_user!- Redirects to sign in if not authenticated