mirror of
https://github.com/wassname/talk.git
synced 2026-10-01 12:42:56 +08:00
Add rest endpoints
This commit is contained in:
1 parent
bb39b4e8fa
commit
505bb48f8b
3 files changed
+29
No files matched your search
@@ -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