nullify this duplicate code prior to deletion.
This commit is contained in:
parent
dee883e76e
commit
ce39a0ca1a
|
|
@ -21,25 +21,25 @@
|
|||
(defparameter *supported-formats* '("mp3" "flac" "ogg" "wav"))
|
||||
|
||||
|
||||
;; Authentication functions
|
||||
(defun require-authentication ()
|
||||
"Require user to be authenticated"
|
||||
(handler-case
|
||||
(unless (session:field "user-id")
|
||||
(radiance:redirect "/asteroid/login"))
|
||||
(error (e)
|
||||
(format t "Authentication error: ~a~%" e)
|
||||
(radiance:redirect "/asteroid/login"))))
|
||||
;; ;; Authentication functions
|
||||
;; (defun require-authentication ()
|
||||
;; "Require user to be authenticated"
|
||||
;; (handler-case
|
||||
;; (unless (session:field "user-id")
|
||||
;; (radiance:redirect "/asteroid/login"))
|
||||
;; (error (e)
|
||||
;; (format t "Authentication error: ~a~%" e)
|
||||
;; (radiance:redirect "/asteroid/login"))))
|
||||
|
||||
(defun require-role (role)
|
||||
"Require user to have a specific role"
|
||||
(handler-case
|
||||
(let ((current-user (get-current-user)))
|
||||
(unless (and current-user (user-has-role-p current-user role))
|
||||
(radiance:redirect "/asteroid/login")))
|
||||
(error (e)
|
||||
(format t "Role check error: ~a~%" e)
|
||||
(radiance:redirect "/asteroid/login"))))
|
||||
;; (defun require-role (role)
|
||||
;; "Require user to have a specific role"
|
||||
;; (handler-case
|
||||
;; (let ((current-user (get-current-user)))
|
||||
;; (unless (and current-user (user-has-role-p current-user role))
|
||||
;; (radiance:redirect "/asteroid/login")))
|
||||
;; (error (e)
|
||||
;; (format t "Role check error: ~a~%" e)
|
||||
;; (radiance:redirect "/asteroid/login"))))
|
||||
|
||||
;; API Routes
|
||||
(define-page admin-scan-library #@"/admin/scan-library" ()
|
||||
|
|
|
|||
Loading…
Reference in New Issue