20 lines
343 B
Go
20 lines
343 B
Go
package auth_middleware
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
func TokenFromSplitCookie(r *http.Request) string {
|
|
dataCookie, err := r.Cookie("DataCookie")
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
signatureCookie, err := r.Cookie("SignatureCookie")
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
cookie := dataCookie.Value + "." + signatureCookie.Value
|
|
return cookie
|
|
}
|