Skip to content

Commit 3e49b7e

Browse files
committed
feat: add is_logged_in cookie response
1 parent 9f66e4e commit 3e49b7e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

core/entity/discord.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ func (at *AccessToken) ToHTTPCookies() Cookies {
5656
MaxAge: at.ExpiresIn,
5757
}
5858

59-
return []*http.Cookie{accessTokenCookie, refreshTokenCookie, tokenTypeCookie, scopeCookie}
59+
isLoggedInCookie := &http.Cookie{
60+
Name: cookiey.CookieIsLoggedIn,
61+
Value: "true",
62+
MaxAge: at.ExpiresIn,
63+
}
64+
65+
return []*http.Cookie{accessTokenCookie, refreshTokenCookie, tokenTypeCookie, scopeCookie, isLoggedInCookie}
6066
}
6167

6268
type RefreshTokenRequest struct {

pkg/cookie/oauth.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ const (
55
CookieAccessToken = "access_token"
66
CookieTokenType = "token_type"
77
CookieScope = "scope"
8+
CookieIsLoggedIn = "is_logged_in"
89
)

0 commit comments

Comments
 (0)