mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 10:15:17 -04:00
docs: consolidate docs (#2182)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
8d46d7e39e
commit
ecffebc43c
307 changed files with 1474 additions and 487 deletions
|
@ -7,7 +7,8 @@ import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-ap
|
|||
|
||||
/**
|
||||
* Requests to log out the current user.
|
||||
* @throws Error if logout is not possible.
|
||||
*
|
||||
* @throws {Error} if logout is not possible.
|
||||
*/
|
||||
export const doLogout = async (): Promise<void> => {
|
||||
await new DeleteApiRequestBuilder('auth/logout').sendRequest()
|
||||
|
|
|
@ -9,11 +9,13 @@ import { AuthError } from './types'
|
|||
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
|
||||
|
||||
/**
|
||||
* Requests to login a user via LDAP credentials.
|
||||
* Requests to log in a user via LDAP credentials.
|
||||
*
|
||||
* @param provider The identifier of the LDAP provider with which to login.
|
||||
* @param username The username with which to try the login.
|
||||
* @param password The password of the user.
|
||||
* @throws {AuthError.INVALID_CREDENTIALS} if the LDAP provider denied the given credentials.
|
||||
* @throws {Error} when the api request wasn't successfull
|
||||
*/
|
||||
export const doLdapLogin = async (provider: string, username: string, password: string): Promise<void> => {
|
||||
await new PostApiRequestBuilder<void, LoginDto>('auth/ldap/' + provider)
|
||||
|
|
|
@ -10,10 +10,12 @@ import { PutApiRequestBuilder } from '../common/api-request-builder/put-api-requ
|
|||
|
||||
/**
|
||||
* Requests to do a local login with a provided username and password.
|
||||
*
|
||||
* @param username The username for which the login should be tried.
|
||||
* @param password The password which should be used to log in.
|
||||
* @throws {AuthError.INVALID_CREDENTIALS} when the username or password is wrong.
|
||||
* @throws {AuthError.LOGIN_DISABLED} when the local login is disabled on the backend.
|
||||
* @throws {Error} when the api request wasn't successful.
|
||||
*/
|
||||
export const doLocalLogin = async (username: string, password: string): Promise<void> => {
|
||||
await new PostApiRequestBuilder<void, LoginDto>('auth/local/login')
|
||||
|
@ -30,11 +32,13 @@ export const doLocalLogin = async (username: string, password: string): Promise<
|
|||
|
||||
/**
|
||||
* Requests to register a new local user in the backend.
|
||||
*
|
||||
* @param username The username of the new user.
|
||||
* @param displayName The display name of the new user.
|
||||
* @param password The password of the new user.
|
||||
* @throws {RegisterError.USERNAME_EXISTING} when there is already an existing user with the same username.
|
||||
* @throws {RegisterError.REGISTRATION_DISABLED} when the registration of local users has been disabled on the backend.
|
||||
* @throws {Error} when the api request wasn't successful.
|
||||
*/
|
||||
export const doLocalRegister = async (username: string, displayName: string, password: string): Promise<void> => {
|
||||
await new PostApiRequestBuilder<void, RegisterDto>('auth/local')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue