alepha@docs:~/docs/reference/providers$
cat NativeAuthTransport.md | pretty1 min read
Last commit:
#NativeAuthTransport
#Import
typescript
1import { NativeAuthTransport } from "@alepha/capacitor/core";
#Overview
ReactAuth's transport inside a native shell: password sign-in against
the API's origin, the session in secure storage, a Bearer header instead of
cookies.
- Every auth request goes to the shell's
apiUrlwithcredentials: "omit": a cookie of the API's origin would never reach a WebView oncapacitor://localhost, and asking for one needs a CORS grant a Bearer API does not give. - Every host-less
$clientcall to the API carries the session's Bearer (LinkProvider.setDefaultAuthorization), and nothing else does: a client naming another hostname never receives it. - At boot, a stored session is restored and validated through
userinfobefore the first page decides anything, inside the router's boot deadline. No response keeps the session and ends on the offline screen; a refused one clears it. - Sign-out revokes the session on the server (
deleteMySession), then forgets it locally whether or not the server answered, and says which.
Installed by AlephaCapacitor in a native shell.