src/prologue/middlewares/csrf

Source   Edit  

Consts

DefaultTokenName = "CSRFToken"
Source   Edit  

Procs

proc checkToken(checked, secret: string): bool {.inline, ...raises: [ValueError],
    tags: [], forbids: [].}
Source   Edit  
proc csrfMiddleWare(tokenName = DefaultTokenName): HandlerAsync {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc csrfToken(ctx: Context; tokenName = DefaultTokenName): string {.inline,
    ...raises: [KeyError, ValueError], tags: [], forbids: [].}
Source   Edit  
proc generateToken(ctx: Context; tokenName = DefaultTokenName): string {.inline,
    ...raises: [KeyError, ValueError], tags: [], forbids: [].}
Source   Edit  
proc getToken(ctx: Context; tokenName = DefaultTokenName): string {.inline,
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc setToken(ctx: Context; value: string; tokenName = DefaultTokenName) {.
    inline, ...raises: [KeyError], tags: [], forbids: [].}
Source   Edit