Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions happycode/tenzero-auth/1.1/config/packages/security.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Managed by happycode/tenzero-auth. Do not edit; configure via happycode_tenzero_auth.
#
# security:

when@test:
security:

Check failure on line 6 in happycode/tenzero-auth/1.1/config/packages/security.yaml

View workflow job for this annotation

GitHub Actions / call-qa / Run checks

Indendation must be a multiple of 4 spaces
password_hashers:
# Password hashers are resource-intensive by design to ensure security.

Check failure on line 8 in happycode/tenzero-auth/1.1/config/packages/security.yaml

View workflow job for this annotation

GitHub Actions / call-qa / Run checks

Indendation must be a multiple of 4 spaces
# In tests, it's safe to reduce their cost to improve performance.

Check failure on line 9 in happycode/tenzero-auth/1.1/config/packages/security.yaml

View workflow job for this annotation

GitHub Actions / call-qa / Run checks

Indendation must be a multiple of 4 spaces
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:

Check failure on line 10 in happycode/tenzero-auth/1.1/config/packages/security.yaml

View workflow job for this annotation

GitHub Actions / call-qa / Run checks

Indendation must be a multiple of 4 spaces
algorithm: auto
cost: 4 # Lowest possible value for bcrypt
time_cost: 3 # Lowest possible value for argon
memory_cost: 10 # Lowest possible value for argon
3 changes: 2 additions & 1 deletion happycode/tenzero-auth/1.1/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"Happycode\\TenZeroAuth\\TenZeroAuthBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
"config/": "%CONFIG_DIR%/",
"src/": "%SRC_DIR%/"
}
}
47 changes: 4 additions & 43 deletions happycode/tenzero-auth/1.1/post-install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,17 @@ Thanks for installing Happycode TenZeroAuth!

Next steps (recommended):

1) Configure the bundle
Add a config file (or edit your existing one):
config/packages/happycode_tenzero_auth.yaml

Minimal example:

happycode_tenzero_auth:
user_class: App\Entity\User
user_field: email

Notes:
- user_class must be your Doctrine User entity class.
- user_field is the identifier field used for login (e.g. "email" or "username").

2) Ensure your User entity is compatible
Your App\Entity\User should extend the bundle base user model provided by TenZeroAuth.
If you haven’t created your User entity yet, generate it (or update it) accordingly

3) JWT keys / ENV vars
1) JWT keys / ENV vars
This bundle expects JWT configuration via environment variables.
Add these to your .env.local (values are placeholders):

php bin/console lexik:jwt:generate-keypair

JWT_SECRET_KEY="[%PROJECT_DIR%]/config/jwt/private.pem"
JWT_PUBLIC_KEY="[%PROJECT_DIR%]/config/jwt/public.pem"
JWT_PASSPHRASE="<your-passphrase>"

Then generate the keypair (if you haven’t already), e.g. using the tooling recommended
by your JWT bundle, and ensure the files exist at the configured paths.

4) Database / migrations
2) Database / migrations
If this recipe adds entities or mapping, generate & run migrations:

php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate

5) Routes / UI
After install, you should have auth endpoints available (login/logout, and optionally register).
Start your server and verify the auth screens load correctly.

6) Optional: customize
You can override defaults such as:
- theme
- app_name / app_description
- enable_register
- login_redirect_url / logout_redirect_url
- token_ttl, reset_password_link_ttl
- access_control overrides (advanced)

If something doesn’t work, double-check:
- Your user_class exists and autoloads
- Your user_class is the expected base type for this bundle
- Your user_field exists on the user (property or getter)
- JWT keys and passphrase are correct
69 changes: 69 additions & 0 deletions happycode/tenzero-auth/1.1/src/Entity/User.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php

declare(strict_types=1);

namespace App\Entity;

use App\Repository\UserRepository;
use Doctrine\ORM\Mapping as ORM;
use Happycode\TenZeroAuth\Model\TenZeroUser;

#[ORM\Entity(repositoryClass: UserRepository::class)]
#[ORM\Table(name: '`user`')]
class User extends TenZeroUser
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;

#[ORM\Column(type: 'string', length: 255)]
private string $firstname = '';

#[ORM\Column(type: 'string', length: 255)]
private string $lastname;

#[ORM\Column(type: 'string', length: 255)]
private string $email;

public function getFirstname(): string
{
return $this->firstname;
}

public function setFirstname(string $firstname): User
{
$this->firstname = $firstname;

return $this;
}

public function getLastname(): string
{
return $this->lastname;
}

public function setLastname(string $lastname): User
{
$this->lastname = $lastname;

return $this;
}

public function getEmail(): string
{
return $this->email;
}

public function setEmail(string $email): User
{
$this->email = $email;

return $this;
}

public function getId(): ?int
{
return $this->id;
}
}
Loading