세션 touch 리퀘스트 처리
This commit is contained in:
@ -553,6 +553,25 @@ func (sh *serviceDescription) authorize(w http.ResponseWriter, r *http.Request)
|
||||
queryvals := r.URL.Query()
|
||||
authtype := queryvals.Get("type")
|
||||
uid := queryvals.Get("id")
|
||||
if sk := queryvals.Get("sk"); len(sk) > 0 {
|
||||
success, err := sh.sessionProvider.Touch(sk)
|
||||
if err != nil {
|
||||
logger.Error("authorize failed. sessionProvider.Touch err:", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
// !success일 때 빈 body를 보내면 클라이언트는 로그아웃 된다.
|
||||
if success {
|
||||
output := map[string]any{
|
||||
"sk": sk,
|
||||
"expirein": sh.sessionTTL.Seconds(),
|
||||
}
|
||||
bt, _ := json.Marshal(output)
|
||||
w.Write(bt)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var email string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user