deno.land / x / alosaur@v1.1.1 / examples / auth / areas / home / home.controller.ts

home.controller.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Controller, Get } from "alosaur/mod.ts";import { Authorize } from "alosaur/src/security/authorization/mod.ts";import { CookiesAuthentication } from "alosaur/src/security/authentication/mod.ts";
const scheme = CookiesAuthentication.DefaultScheme;
@Controller("")export class HomeController { @Get("") getText() { return "Hello world! <a href='/protected'>go to protected page</a>"; }
@Authorize(scheme) @Get("/protected") getProtectedData() { return "Hi! this protected info. <br> <a href='/account/logout'>logout</a>"; }}
alosaur

Version Info

Tagged at
a year ago