當(dāng)用戶通過 user.LogoutURL 路徑注銷 GAE 應(yīng)用程序時,我想在他們注銷時執(zhí)行其他操作。如何使用特定處理程序覆蓋它(例如:https : //cloud.google.com/appengine/docs/go/users/#Go_User_authentication_in_Go)并仍然執(zhí)行所需的注銷操作?或者我怎樣才能檢測到用戶正在注銷然后執(zhí)行我想要的操作?
1 回答

DIEA
TA貢獻(xiàn)1820條經(jīng)驗 獲得超3個贊
您可以做的是創(chuàng)建自己的注銷處理程序,然后重定向到user.LogoutURL.
func logoutHandler(w http.ResponseWriter, r *http.Request) {
c := appengine.NewContext(r)
// do what you want to do here.
http.Redirect(w, r, users.LogoutURL(c))
}
- 1 回答
- 0 關(guān)注
- 219 瀏覽
添加回答
舉報
0/150
提交
取消