Hi, I’m trying to implement `browser logout` and...
# ory-network
a
Hi, I’m trying to implement
browser logout
and i’m getting
401 Unauthorized
Copy code
"reason":"No active session was found in this request.","message":"request does not have a valid authentication session"
But before that, i called
is.oryAPI.FrontendApi.ToSession(ctx).Cookie(cookie).Execute()
, and it is telling me that the session is active. I also got the
logouttToken
and
logOutUrl
Partial code
Copy code
logoutFlow, res, err := is.oryAPI.FrontendApi.CreateBrowserLogoutFlow(ctx).Cookie(cookie).Execute()

// Error when trying to update logout flow
res, err = is.oryAPI.FrontendApi.UpdateLogoutFlow(ctx).Token(logoutFlow.LogoutToken).Execute()
Any idea what might’ve went wrong?
An update to this, i’ve found out that it was due to the fact that
FrontendApi.UpdateLogoutFlow
doesnt include
cookie
like other endpoint. i modified it to include cookie and it just works. But the SDK doesnt have
.Cookie()
method.
@magnificent-energy-493 i’ve updated the issue in github as well. Can anyone take a look at this? It is blocking us from implementing logout https://github.com/ory/sdk/issues/255
103 Views