orioons-auth
v1.3.1
Published
Package for Orioons Authentication Service
Downloads
16
Maintainers
Readme
Orioons Auth SDK
SDK for Orioons Authentication Service
Installation
npm install orioons-auth
Usage
First, require the SDK and create an instance with the provided configuration.
const OrioonsAuth = require('orioons-auth');
const config = {
_id: "APP ID HERE",
server: "DATACENTER LOCATION",
appSecret: "SECRET HERE",
bucketID: "APPLICATION BUCKET ID",
rgnID: "UNIQUE REGIONAL SECTION ID"
};
const auth = new OrioonsAuth(config);
Adding a User
const userDetails = {
email: '[email protected]',
password: 'password',
displayName: 'Test User'
};
auth.addUser(userDetails).then(response => {
console.log(response);
}).catch(error => {
console.error(error);
});
Removing a User
const userId = 'user-id-to-remove';
auth.removeUser(userId).then(response => {
console.log(response);
}).catch(error => {
console.error(error);
});
Logging in a User
const userCredentials = {
email: '[email protected]',
password: 'password'
};
auth.loginUser(userCredentials).then(response => {
console.log(response);
}).catch(error => {
console.error(error);
});
Deactivating a User
const userId = 'user-id-to-deactivate';
auth.deactivateUser(userId).then(response => {
console.log(response);
}).catch(error => {
console.error(error);
});
Changing User Password
const userId = 'user-id-to-reset';
const oldPassword = 'old-password';
const newPassword = 'new-password';
auth.userResetPassword(userId, oldPassword, newPassword).then(response => {
console.log(response);
}).catch(error => {
console.error(error);
});
Change User Email
const userId = 'user-id-to-change';
const newEmail = '[email protected]';
auth.changeEmail(userId, newEmail).then(response => {
console.log(response);
}).catch(error => {
console.error(error);
});
License
This project is licensed under the MIT License - see the LICENSE file for details.
LICENSE
MIT License
Copyright (c) 2024 Intredia LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.