@mantiq/core 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/contracts/Request.ts +1 -0
- package/src/http/Request.ts +6 -0
package/package.json
CHANGED
package/src/contracts/Request.ts
CHANGED
package/src/http/Request.ts
CHANGED
|
@@ -193,6 +193,12 @@ export class MantiqRequest implements MantiqRequestContract {
|
|
|
193
193
|
|
|
194
194
|
// ── Auth ─────────────────────────────────────────────────────────────────
|
|
195
195
|
|
|
196
|
+
bearerToken(): string | null {
|
|
197
|
+
const auth = this.header('authorization')
|
|
198
|
+
if (!auth || !auth.startsWith('Bearer ')) return null
|
|
199
|
+
return auth.slice(7).trim() || null
|
|
200
|
+
}
|
|
201
|
+
|
|
196
202
|
user<T = any>(): T | null {
|
|
197
203
|
return this.authenticatedUser as T | null
|
|
198
204
|
}
|