Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nextcloud-libraries/nextcloud-auth

Nextcloud helpers related to authentication and the current user https://npmjs.org/@nextcloud/auth
https://github.com/nextcloud-libraries/nextcloud-auth

authentication javascript-library nextcloud nextcloud-plugin

Last synced: about 2 months ago
JSON representation

Nextcloud helpers related to authentication and the current user https://npmjs.org/@nextcloud/auth

Awesome Lists containing this project

README

        

# @nextcloud/auth

[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud-libraries/nextcloud-auth)](https://api.reuse.software/info/github.com/nextcloud-libraries/nextcloud-auth)
[![npm](https://img.shields.io/npm/v/@nextcloud/auth.svg)](https://www.npmjs.com/package/@nextcloud/auth)
[![Documentation](https://img.shields.io/badge/Documentation-online-brightgreen)](https://nextcloud-libraries.github.io/nextcloud-auth/index.html)

Nextcloud helpers related to authentication and the current user

## Install

```sh
npm install @nextcloud/auth --save
```

```sh
yarn add @nextcloud/auth
```

## Usage
For detailed information check [the package documentation](https://nextcloud-libraries.github.io/nextcloud-auth/index.html).

One example usage to get the current user:
```ts
import { getCurrentUser } from '@nextcloud/auth'

const user = getCurrentUser()

if (user.isAdmin) {
// do something
}
```