helllomatt/aspen-user-api

API module for the ASPEN framework to manage users and authentication.

1.0 2017-05-09 16:46 UTC

This package is not auto-updated.

Last update: 2024-04-27 17:31:58 UTC


README

This is an API used to allow for user management using the ASPEN framework. Users can:

  • Register new accounts
  • Activate accounts
  • Reset passwords via request
  • Log in via OAuth2 or Session
  • Update information (when logged in)
  • Change their password (when logged in)

How to install

There's two parts: firstly install the package, secondly set up the database.

Installing the package:

composer require helllomatt/aspen-user-api

Setting up the database:

  1. Navigate to the package .../vendor/helllomatt/aspen-user-api
  2. In the root folder you'll find db.sql
  3. Import db.sql into your database

Code updates

In your index.php file there are two changes that need to be made.

  1. Add session_start() under require 'vendor/autoload.php' (if you plan to use session based auth)
  2. Add vendor/helllomatt/aspen-user-api to the manager's load() array

After that, you're ready to use the API.

Running tests

Tests require an actual database connection.

Modify the phpunit.xml file to reflect your database setup for running tests.