mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 05:17:19 +08:00
Add rest endpoints
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
export { default as signIn, SignInInput } from "./signIn";
|
||||
export { default as signUp, SignUpInput } from "./signUp";
|
||||
@@ -0,0 +1,13 @@
|
||||
import { RestClient } from "../lib/rest";
|
||||
|
||||
export interface SignInInput {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export default function signIn(rest: RestClient, input: SignInInput) {
|
||||
return rest.fetch("/tenant/auth/local", {
|
||||
method: "POST",
|
||||
body: input,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { RestClient } from "../lib/rest";
|
||||
|
||||
export interface SignUpInput {
|
||||
username: string;
|
||||
password: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export default function signUp(rest: RestClient, input: SignUpInput) {
|
||||
return rest.fetch("/tenant/auth/local/signup", {
|
||||
method: "POST",
|
||||
body: input,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user