update server error response and lazy load img
This commit is contained in:
parent
36c71eda38
commit
59407840cd
3 changed files with 7 additions and 1 deletions
|
|
@ -168,6 +168,11 @@ func (ar *AuthRouter) Route(r chi.Router) {
|
|||
token.RefreshToken = cookie.Value
|
||||
}
|
||||
|
||||
if token.AccessToken == "" && token.RefreshToken == "" {
|
||||
http.Error(w, "Unauthorized", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
// get user info
|
||||
client := ar.gConfig.Client(r.Context(), token)
|
||||
resp, err := client.Get("https://www.googleapis.com/oauth2/v3/userinfo")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue