Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.
/ ToolipsAuth.jl Public archive

Easy universal authentication for clients in Julia.

License

Notifications You must be signed in to change notification settings

ChifiSource/ToolipsAuth.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dead repo

ToolipsAuth is now a part of ToolipsSession in Toolips 0.3. ToolipsSession.

  • ( This project can still be used with Toolips 0.2. )
universal authentication for toolips

Authentication has long been a daunting and problematic task for many developers, but this is no more with toolips. Using this extension, we can create different experiences for different groups just by writing different functions!

  • step 1: add toolips auth to your webapp:
using Toolips
using Pkg

Toolips.new_webapp("MyApp")
Pkg.add("ToolipsAuth")
  • step 2: add toolips auth to your extension vector:
routes = [route("/", home), fourofour]
extensions = Vector{ServerExtension}([Logger(), Files(), Session(), Auth()])
  • step 3: use toolips auth. The group method is passed a Connection, String, and Function to produce the high-level syntax. clients are grouped as 'new' by default.
function home(c::Connection)
    group(c, "user") do c::Connection
        write!(c, "this is the user page")
    end
    group(c, "new") do c::Connection
        group!(c, "user", reset = true)
        write!(c, "you are now a user!, click below to reload!")
        b = button("reload", text = "reload")
        on(c, b, "click") do cm::ComponentModifier
            redirect!(cm, "/")
        end
        write!(c, [br(), b])
    end
end

About

Easy universal authentication for clients in Julia.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages