phycom/auth

Authentication module for Phycom platform

Installs: 389

Dependents: 0

Suggesters: 0

Security: 0

Type:yii2-extension

1.1.2 2022-08-19 07:46 UTC

This package is auto-updated.

Last update: 2024-04-19 11:23:57 UTC


README

Authentication module for Phycom platform

Contains a collection of 3rd party authentication methods that can be easily added to phycom website.

List of methods provided:

  • Facebook
  • Google

Installation

Install using composer:

composer install phycom/auth

How to use the module

  1. Add module config your site, see example here:
<?php

return  [
    'modules' => [
        'auth' => [
            'class' => \Phycom\Auth\Module::class,
            'methods' => [
                'google' => [
                    'class' => \Phycom\Auth\Methods\Google\Module::class,
                    'clientId' => '<your google client ID here>'
                ],
                'facebook' => [
                    'class' => \Phycom\Auth\Methods\Facebook\Module::class,
                    'appId' => '<your facebook ap id here>'
                ]
            ]
        ]
    ]
];

  1. Add auth. methods to your login form like this:

foreach (Yii::$app->getModule('auth')->getMethods() as $method) {
    echo $method->render();
}