mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 16:44:49 -04:00
Feature/history api (#84)
added /api/v2.0/ to the backend url Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
e2155e735d
commit
02f1b2abcc
8 changed files with 76 additions and 37 deletions
|
@ -1,7 +1,7 @@
|
|||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { Alert, Button, Card, Form } from 'react-bootstrap'
|
||||
import React, { FormEvent, useState } from 'react'
|
||||
import { postEmailLogin } from '../../../../../api/user'
|
||||
import { doEmailLogin } from '../../../../../api/user'
|
||||
import { getAndSetUser } from '../../../../../utils/apiUtils'
|
||||
|
||||
export const ViaEMail: React.FC = () => {
|
||||
|
@ -11,7 +11,7 @@ export const ViaEMail: React.FC = () => {
|
|||
const [error, setError] = useState(false)
|
||||
|
||||
const doAsyncLogin = async () => {
|
||||
await postEmailLogin(email, password)
|
||||
await doEmailLogin(email, password)
|
||||
await getAndSetUser()
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { FormEvent, useState } from 'react'
|
|||
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { Alert, Button, Card, Form } from 'react-bootstrap'
|
||||
import { postLdapLogin } from '../../../../../api/user'
|
||||
import { doLdapLogin } from '../../../../../api/user'
|
||||
import { getAndSetUser } from '../../../../../utils/apiUtils'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { ApplicationState } from '../../../../../redux'
|
||||
|
@ -19,7 +19,7 @@ export const ViaLdap: React.FC = () => {
|
|||
|
||||
const doAsyncLogin = async () => {
|
||||
try {
|
||||
await postLdapLogin(username, password)
|
||||
await doLdapLogin(username, password)
|
||||
await getAndSetUser()
|
||||
} catch {
|
||||
setError(true)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { FormEvent, useState } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { Alert, Button, Card, Form } from 'react-bootstrap'
|
||||
import { postOpenIdLogin } from '../../../../../api/user'
|
||||
import { doOpenIdLogin } from '../../../../../api/user'
|
||||
import { getAndSetUser } from '../../../../../utils/apiUtils'
|
||||
|
||||
export const ViaOpenId: React.FC = () => {
|
||||
|
@ -9,7 +9,7 @@ export const ViaOpenId: React.FC = () => {
|
|||
const [openId, setOpenId] = useState('')
|
||||
const [error, setError] = useState(false)
|
||||
const doAsyncLogin: (() => Promise<void>) = async () => {
|
||||
await postOpenIdLogin(openId)
|
||||
await doOpenIdLogin(openId)
|
||||
await getAndSetUser()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue