mirror of
https://github.com/balzack/databag.git
synced 2025-04-23 10:05:19 +00:00
added missing file
This commit is contained in:
parent
5e145f8950
commit
ce459b5672
@ -34,7 +34,6 @@ export function Access() {
|
||||
actions.setLoading(true)
|
||||
otpClose()
|
||||
try {
|
||||
await new Promise((r) => setTimeout(r, 2000))
|
||||
if (state.mode === 'account') {
|
||||
await actions.accountLogin()
|
||||
} else if (state.mode === 'create') {
|
||||
@ -95,6 +94,7 @@ export function Access() {
|
||||
<TextInput
|
||||
className={classes.input}
|
||||
size="md"
|
||||
value={state.username}
|
||||
leftSectionPointerEvents="none"
|
||||
leftSection={<IconUser />}
|
||||
placeholder={state.strings.username}
|
||||
@ -105,6 +105,7 @@ export function Access() {
|
||||
<PasswordInput
|
||||
className={classes.input}
|
||||
size="md"
|
||||
value={state.password}
|
||||
leftSection={<IconLock />}
|
||||
placeholder={state.strings.password}
|
||||
onChange={(event) =>
|
||||
@ -210,6 +211,7 @@ export function Access() {
|
||||
<TextInput
|
||||
className={classes.input}
|
||||
size="md"
|
||||
value={state.username}
|
||||
leftSectionPointerEvents="none"
|
||||
leftSection={<IconUser />}
|
||||
placeholder={state.strings.username}
|
||||
@ -221,6 +223,7 @@ export function Access() {
|
||||
<PasswordInput
|
||||
className={classes.input}
|
||||
size="md"
|
||||
value={state.password}
|
||||
leftSection={<IconLock />}
|
||||
placeholder={state.strings.password}
|
||||
onChange={(event) =>
|
||||
@ -230,6 +233,7 @@ export function Access() {
|
||||
<PasswordInput
|
||||
className={classes.input}
|
||||
size="md"
|
||||
value={state.confirm}
|
||||
leftSection={<IconLock />}
|
||||
placeholder={state.strings.confirmPassword}
|
||||
onChange={(event) =>
|
||||
@ -273,6 +277,7 @@ export function Access() {
|
||||
<PasswordInput
|
||||
className={classes.input}
|
||||
size="md"
|
||||
value={state.password}
|
||||
leftSection={<IconLock />}
|
||||
placeholder={state.strings.password}
|
||||
onChange={(event) =>
|
||||
|
16
app/sdk/src/net/getUsername.ts
Normal file
16
app/sdk/src/net/getUsername.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import axios from 'redaxios';
|
||||
|
||||
export async function getUsername(name: string, token: string, node: string, secure: boolean): boolean {
|
||||
const param = token ? `&token=${token}` : '';
|
||||
const username = encodeURIComponent(name)
|
||||
const endpoint = `http${secure ? 's' : ''}://${node}/account/username?name=${username}${param}`;
|
||||
const response = await axios.get(endpoint);
|
||||
if (response.status >= 400 && response.status < 600) {
|
||||
throw new Error('getAvailable fetch failed');
|
||||
}
|
||||
if (typeof response.data !== 'boolean') {
|
||||
throw new Error('getAvailable response failed');
|
||||
}
|
||||
return response.data;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user