improved UI
This commit is contained in:
1 parent
520fab5c93
commit
e9da24b54d
13 files changed
+491
-32
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { Router } from "https://deno.land/x/oak/mod.ts";
|
||||
|
||||
|
||||
export const loginRouter = new Router();
|
||||
|
||||
export function isLoggedIn(ctx){
|
||||
return ctx.request.headers.get('dgt-session')
|
||||
}
|
||||
|
||||
|
||||
loginRouter.post("/api/v1/login", async (ctx)=> {
|
||||
const username = (await ctx.request.body().value).get("username");
|
||||
ctx.response.headers.append("HX-Trigger", JSON.stringify({'login': username}));
|
||||
ctx.response.body = username;
|
||||
});
|
||||
|
||||
loginRouter.post("/api/v1/logout", (ctx)=> {
|
||||
ctx.response.headers.append("HX-Trigger", "logout");
|
||||
ctx.response.body = "";
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user