chickadee » oauthtoothy » oauthtoothy-middleware

oauthtoothy-middleware providers #!key success-redirect save-proc load-procprocedure

Creates OAuth2 authentication middleware for Schematra applications.

Parameters:

  • providers: List of OAuth2 provider configurations
  • success-redirect: URL to redirect to after successful authentication (default: "/")
  • save-proc: Function to save user data for persistence: (lambda (provider-id provider-name user-data token) ...) (optional)
  • load-proc: Function to load user data from storage: (lambda (provider-id provider-name) ...) (optional)
;; Basic setup
(oauthtoothy-middleware (list google-provider))

;; With custom redirect and persistence
(oauthtoothy-middleware
 (list google-provider github-provider)
 success-redirect: "/dashboard"
 save-proc: save-user-to-db
 load-proc: load-user-from-db)