Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Connecting applications to Hyvor Authentication: API and Webhook handlers

Notifications You must be signed in to change notification settings

hyvor/laravel-hyvor-connecter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docs

Installation

composer require hyvor/laravel-hyvor-connecter

Config

Add these to the .env

  • HYVOR_URL - URL of Hyvor. This is internal IP in production. In testing, you may use the local URL.
  • HYVOR_API_KEY - API Key.
  • HYVOR_DUMMY - Set this to true in development so that dummy data will be return. Therefore, you don't need to have the auth set up and running to test the other application. Login check will always be true when using this.

Hyvor User Object

The properties of the HyvorUser object, which is returned in endpoints.

public int $id;
public string $username;
public string $name;
public string $email;
public ?string $picture_url;
public ?string $location;
public ?string $bio;
public ?string $website_url;

Checking Login

use Hyvor\HyvorConnecter\Login;

$user = Login::check(); // null | HyvorUser

Getting User Data

use Hyvor\HyvorConnecter\Userbase;

// get one from ID (email is not set in the HyvorUser object)
Userbase::fromId($id);

// get one from ID with email
Userbase::fromId($id, true);

// get multiple from ID
Userbase::fromIds([$id1, $id2, ...], bool $email);

Userbase::fromUsername();
Userbase::fromUsernames();
Userbase::fromEmail();
Userbase::fromEmails();

Redirecting to Auth

Return URL will be added automatically so that the user will come back to the page specified after logging in or signing up.

use Hyvor\HyvorConnecter\Redirect;

Redirect::to('account');
Redirect::toLogin();
Redirect::toSignup();

About

Connecting applications to Hyvor Authentication: API and Webhook handlers

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages