🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@koompi/auth

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koompi/auth

This is a client library for interacting with the API of a service called KOOMPI Auth. It provides functions for login, registration, password change, and Google login.

1.0.2
latest
npm
Version published
Maintainers
1
Created
Source

KOOMPI Auth

This is a client library for interacting with the API of a service called KOOMPI Auth. It provides functions for login, registration, password change, and Google login.

Installation

To use this library, you need to have Node.js and npm installed on your system. Then, follow these steps:

npm install @koompi/auth
or
yarn add @koompi/auth

Usage

First, import the API client into your JavaScript/TypeScript file:

import auth from "@koompi/auth";

Login

To perform a login operation, use the login function:

auth.login({ email: "user@example.com", password: "password123" })
  .then((data) => {
    // Handle the response data
  })
  .catch((error) => {
    // Handle any errors
  });

Registration

To register a new user, use the register function:

auth.register({
  fullname: "John Doe",
  email: "johndoe@example.com",
  password: "password123",
  confirmPassword: "password123",
})
  .then((data) => {
    // Handle the response data
  })
  .catch((error) => {
    // Handle any errors
  });

Google Login

To perform a login operation using Google, use the loginWithGoogle function:

auth.loginWithGoogle({ tokenId: "googleToken123" })
  .then((data) => {
    // Handle the response data
  })
  .catch((error) => {
    // Handle any errors
  });

Offline Registration (For School Management System)

To register a new user offline, use the offlineRegister function:

auth.offlineRegister({
  firstname: "John",
  lastname: "Doe",
  email: "johndoe@example.com",
  password: "password123",
})
  .then((data) => {
    // Handle the response data
  })
  .catch((error) => {
    // Handle any errors
  });

Change Password

To change the password, use the changePassword function:

auth.changePassword({
  token: "changeToken123",
  password: "newPassword123",
  confirmPassword: "newPassword123",
})
  .then((data) => {
    // Handle the response data
  })
  .catch((error) => {
    // Handle any errors
  });

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please create a new issue or submit a pull request.

License

This project is licensed under the MIT License.

Keywords

koompi

FAQs

Package last updated on 05 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts