# extendify/0.9.3/app/Library/Controllers/AuthController.php

Extendify, version 0.9.3. 44 lines.

- Page: https://pluginprobe.com/plugins/extendify/0.9.3/code/app/Library/Controllers/AuthController.php
- Raw: https://pluginprobe.com/plugins/extendify/0.9.3/raw/app/Library/Controllers/AuthController.php
- Modified: 2022-05-27T00:51:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/0.9.3/code/app/Library/Controllers/AuthController.php#L10-L20`.

```php
<?php
/**
 * Controls Auth
 */

namespace Extendify\Library\Controllers;

use Extendify\Http;

if (!defined('ABSPATH')) {
    die('No direct access.');
}

/**
 * The controller for dealing registration and authentication
 */
class AuthController
{

    /**
     * Login a user to extendify - it will return the API key
     *
     * @param \WP_REST_Request $request - The request.
     * @return WP_REST_Response|WP_Error
     */
    public static function login($request)
    {
        $response = Http::post('/login', $request->get_params());
        return new \WP_REST_Response($response);
    }

    /**
     * Handle registration - It will return the API key.
     *
     * @param \WP_REST_Request $request - The request.
     * @return WP_REST_Response|WP_Error
     */
    public static function register($request)
    {
        $response = Http::post('/register', $request->get_params());
        return new \WP_REST_Response($response);
    }
}

```
