You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the Authentication via SDK has some inconsistencies. To be more precise the issue is with both operation arguments as well as defaults used for each one (for now I can confirm with rest, but also auth isn't clear):
Description
I'll separate the Rest description form the Auth questions
Both correctly defaults to cookie, no docs info (assuming json as login), but also the order of the arguments is inconsistent.
Which comes first, the chicken or the egg?
Also the body: JSON.stringify(....) is inconsistent, causing potential developer error in making the refresh work, but not the logout (and vice versa).
In the auth's login the mode can be manually overwritten, but what would be the advantage if it cannot be also overwritten for logout and refresh? Wouldn't this cause inability for neither refreshing nor invalidating user's sessions if the developer erroneously edited the mode during login?
These issues were original discussed inside the nuxt-directus#254 issue. But only now confirmed as I finally have noticed my error in the order of arguments for refresh and logout, and documentation declaring a different default.
Directus Version
v10.10.5
Hosting Strategy
Self-Hosted (Docker Image)
The text was updated successfully, but these errors were encountered:
Some good points of inconsistencies that have cropped up over time. A small disclaimer the linked docs pages under "API reference" were written for the API not the SDK and while they have a lot of overlap if there are conflicting defaults we have no good place to document that currently.
The default being cookie in the SDK is actually the error here as it is correctly documented to be json for the API but a different decision was made for the SDK early on which requires a breaking change to fix and misses a place to properly document that beyond the auto-generated reference in the documentation.
Describe the Bug
Currently the Authentication via SDK has some inconsistencies. To be more precise the issue is with both operation arguments as well as defaults used for each one (for now I can confirm with
rest
, but alsoauth
isn't clear):Description
I'll separate the Rest description form the Auth questions
Rest
login
:Code defaults to
cookie
(as it should)directus/sdk/src/rest/commands/auth/login.ts
Line 24 in 75c03bd
While docs say
json
Screenshot
logout
andrefresh
Both correctly defaults to
cookie
, no docs info (assumingjson
as login), but also the order of the arguments is inconsistent.Which comes first, the chicken or the egg?
Also the
body: JSON.stringify(....)
is inconsistent, causing potential developer error in making therefresh
work, but not thelogout
(and vice versa).directus/sdk/src/rest/commands/auth/logout.ts
Lines 12 to 18 in 75c03bd
directus/sdk/src/rest/commands/auth/refresh.ts
Lines 12 to 21 in 75c03bd
Auth
login
'smode
vslogout
andrefresh
In the auth's
login
the mode can be manually overwritten, but what would be the advantage if it cannot be also overwritten forlogout
andrefresh
? Wouldn't this cause inability for neither refreshing nor invalidating user's sessions if the developer erroneously edited the mode during login?login
:directus/sdk/src/auth/composable.ts
Line 131 in 75c03bd
logout
:directus/sdk/src/auth/composable.ts
Line 167 in 75c03bd
refresh
:directus/sdk/src/auth/composable.ts
Line 103 in 75c03bd
To Reproduce
These issues were original discussed inside the
nuxt-directus
#254 issue. But only now confirmed as I finally have noticed my error in the order of arguments forrefresh
andlogout
, and documentation declaring a different default.Directus Version
v10.10.5
Hosting Strategy
Self-Hosted (Docker Image)
The text was updated successfully, but these errors were encountered: