This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// src/User/Message/createUserHandler.php | |
namespace App\User\Handler; | |
use Doctrine\ORM\EntityManagerInterface; | |
use Exception; | |
use App\Domain\User\Entity\User; | |
use App\Domain\Translation\ValueObject\ErrorMessage; | |
use App\User\Message\CreateUserMessage; | |
use Symfony\Component\Messenger\Handler\MessageHandlerInterface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// src/User/Action/CreateUser.php | |
namespace App\User\Action; | |
use App\Core\REST\Action\AbstractApiAction; | |
use App\Core\REST\ValueObject\ApiResponse; | |
use App\Domain\User\Representation\UserRepresentation; | |
use App\User\Message\CreateUserMessage; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\Routing\Annotation\Route; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// src/User/Message/CreateUserMessage.php | |
namespace App\User\Message; | |
use Assert\Assert; | |
use Symfony\Component\HttpFoundation\Request; | |
/** | |
* Class CreateUserMessage | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// src/Domain/User/Entity/User.php | |
namespace App\Domain\User\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use App\Domain\User\Repository\UserRepository; | |
use Symfony\Component\Validator\Constraints as Assert; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:PutObject", | |
"s3:GetObjectAcl", | |
"s3:GetObject", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SitemapGenerator::Sitemap.sitemaps_path = "sitemaps/" //find the folder in the S3 bucket | |
SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new(ENV.fetch("S3_BUCKET_NAME"), | |
aws_access_key_id: ENV.fetch("AWS_ACCESS_KEY_ID"), | |
aws_secret_access_key: ENV.fetch("AWS_SECRET_ACCESS_KEY"), | |
region: ENV.fetch("AWS_REGION") | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/turbo_controller.rb | |
class TurboController < ApplicationController | |
class Responder < ActionController::Responder | |
def to_turbo_stream | |
controller.render(options.merge(formats: :html)) | |
rescue ActionView::MissingTemplate => error | |
if get? | |
raise error | |
elsif has_errors? && default_action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_column(:users, :provider, :string, limit: 50, null: false, default:'') | |
add_column(:users, :uid, :string, limit: 50, null: false, default:'') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/fix_omniauth.rb | |
begin | |
require "omniauth" | |
require "omniauth/version" | |
rescue LoadError => e | |
warn "Could not load 'omniauth'. Please ensure you have the omniauth gem >= 1.0.0 installed and listed in your Gemfile." | |
raise | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controller/omniauth_callbacks_controller.rb | |
class OmniauthCallbacksController < Devise::OmniauthCallbacksController | |
def microsoft_office365 | |
callback_from :microsoft_office365 | |
end | |
def failure | |
redirect_to after_omniauth_failure_path_for(resource_name) | |
end |
OlderNewer