https://github.com/developedbyme/dbm-custom-login
Functionality to create custom login pages using the dbm-content plugin for WordPress
https://github.com/developedbyme/dbm-custom-login
wordpress wp
Last synced: about 1 month ago
JSON representation
Functionality to create custom login pages using the dbm-content plugin for WordPress
- Host: GitHub
- URL: https://github.com/developedbyme/dbm-custom-login
- Owner: developedbyme
- License: mit
- Created: 2018-05-18T12:02:01.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T08:02:18.000Z (about 2 years ago)
- Last Synced: 2025-04-02T10:44:24.685Z (about 1 year ago)
- Topics: wordpress, wp
- Language: PHP
- Homepage: http://developedbyme.com
- Size: 67.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
Custom login for Dbm content
# API
## Data structures
### User
```
{
id: int,
permalink: url,
name: string,
gravatarHash: string
}
```
### UserWithPrivateData extends User
```
{
id: int (from User),
permalink: url (from User),
firstName: string,
lastName: string,
name: string (from User),
email: string,
gravatarHash: string (from User)
}
```
## Endpoints
### Login
Logs in the user in and sets the cookie that controlls if the user is logged in.
#### Request
POST `/wp-json/wprr/v1/action/login`
```
{
log: string,
pwd: string,
remember: boolean
}
```
#### Response
```
{
code: "success",
data: {
authenticated: boolean,
user: UserWithPrivateData,
roles: array of string,
restNonce: string,
restNonceGeneratedAt: unix timestamp
}
}
```
#### Errors
HTTP 500 if the authentication doesn't go through
### Logout
#### Request
POST `/wp-json/wprr/v1/action/logout`
```
{}
```
#### Response
```
{
code: "success",
data: {
authenticated: false,
loggedOutUser: int
}
}
```
### Has user
Check if an email is registered as a user
#### Request
POST `/wp-json/wprr/v1/action/has-user`
```
{
email: string
}
```
#### Response
```
{
code: "success",
data: {
hasUser: boolean,
[userId: int]
}
}
```
### Register user
Registers a user according to a specified method. Based on the method and the server settings the server might run the login directly after registration.
#### Request
POST `/wp-json/wprr/v1/action/register-user`
```
{
method: string (default: "default")
email: string,
password: string,
firstName: string,
lastName: string,
[additional verification data]
[additional meta data]
}
```
#### Response
```
{
code: "success",
data: {
registered: boolean,
[verified: boolean],
[alreadyRegistered: true],
[userId: int],
[user: UserWithPrivateData],
[roles: array of string],
[restNonce: string],
[restNonceGeneratedAt: unix timestamp]
}
}
```
#### Errors
Note that the call can give you a code "success" and registered false, which means that the registration did not get through for some reason.