Connector Update
This commit is contained in:
parent
73fe3a3c9a
commit
0b06c252a3
|
|
@ -9,7 +9,7 @@ declare global
|
||||||
{
|
{
|
||||||
namespace Express
|
namespace Express
|
||||||
{
|
{
|
||||||
interface Request { auth?: AuthPayload; }
|
interface Request { auth?: AuthPayload; rawToken?: string; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,7 +100,8 @@ export function jwtMiddleware( req: Request, res: Response, next: NextFunction )
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
req.auth = jwt.verify( token, JWT_SECRET ) as AuthPayload;
|
req.auth = jwt.verify( token, JWT_SECRET ) as AuthPayload;
|
||||||
|
req.rawToken = token;
|
||||||
next();
|
next();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -136,7 +137,8 @@ export function jwtMiddleware( req: Request, res: Response, next: NextFunction )
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
req.auth = jwt.verify( result.accessToken, JWT_SECRET ) as AuthPayload;
|
req.auth = jwt.verify( result.accessToken, JWT_SECRET ) as AuthPayload;
|
||||||
|
req.rawToken = result.accessToken;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3>In your service repo</h3>
|
<h3>In your service repo</h3>
|
||||||
<pre><code>git submodule add https://community.rokojori.com/Rokojori/rokojori-auth-connector.git source/auth-connector
|
<pre><code>git submodule add git@community.rokojori.com:Rokojori/rokojori-auth-connector.git source/auth-connector
|
||||||
git submodule update --init</code></pre>
|
git submodule update --init</code></pre>
|
||||||
<p style="margin-top:0.75rem">
|
<p style="margin-top:0.75rem">
|
||||||
This creates <code>source/auth-connector/</code> inside your service repo.
|
This creates <code>source/auth-connector/</code> inside your service repo.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue