first commit

This commit is contained in:
zickkeen committed 2024-03-17 11:39:27 +07:00
commit d0e185820a
2710 files changed
+465112

No files matched your search

@@ -0,0 +1,85 @@
<?php
use Phinx\Migration\AbstractMigration;
class CreateSocialProfiles extends AbstractMigration
{
public function change()
{
$table = $this->table('social_profiles');
$table
->addColumn('user_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
])
->addColumn('provider', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
])
->addColumn('access_token', 'blob')
->addColumn('identifier', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
])
->addColumn('username', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
])
->addColumn('first_name', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
])
->addColumn('last_name', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
])
->addColumn('full_name', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
])
->addColumn('email', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
])
->addColumn('birth_date', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
])
->addColumn('gender', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
])
->addColumn('picture_url', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
])
->addColumn('email_verified', 'boolean', [
'default' => false,
'null' => false,
])
->addColumn('created', 'datetime', [
'default' => null,
'null' => true,
])
->addColumn('modified', 'datetime', [
'default' => null,
'null' => true,
])
->addIndex(
[
'user_id',
]
)
->create();
}
}
+5
View File
@@ -0,0 +1,5 @@
<?php
use ADmad\SocialAuth\Database\Type\SerializeType;
use Cake\Database\Type;
Type::map('socialauth.serialize', SerializeType::class);
+29
View File
@@ -0,0 +1,29 @@
<?php
/**
* ADmad\SocialAuth plugin.
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
*/
use Cake\Routing\Router;
Router::plugin(
'ADmad/SocialAuth',
['path' => '/social-auth'],
function ($routes) {
$routes->connect(
'/login/:provider',
['controller' => 'Auth', 'action' => 'login'],
['pass' => ['provider']]
);
$routes->connect(
'/callback/:provider',
['controller' => 'Auth', 'action' => 'callback'],
['pass' => ['provider']]
);
$routes->connect(
'/callback',
['controller' => 'Auth', 'action' => 'callback']
);
}
);