mirror of
https://git.waldn.net/git/knotteye/satyr.git
synced 2025-05-07 13:49:23 +00:00
Fix a bug where we weren't setting X-Auth-As on /api/register
Also fix new users appearing to not exist until they update their bio/profile
This commit is contained in:
parent
814d826ec9
commit
7156accbee
@ -254,6 +254,7 @@ async function initAPI() {
|
|||||||
api.register(req.body.username, req.body.password, req.body.confirm, true).then((result) => {
|
api.register(req.body.username, req.body.password, req.body.confirm, true).then((result) => {
|
||||||
if(result[0]) return genToken(req.body.username).then((t) => {
|
if(result[0]) return genToken(req.body.username).then((t) => {
|
||||||
res.cookie('Authorization', t, {maxAge: 604800000, httpOnly: true, sameSite: 'Lax'});
|
res.cookie('Authorization', t, {maxAge: 604800000, httpOnly: true, sameSite: 'Lax'});
|
||||||
|
res.cookie('X-Auth-As', req.body.username, {maxAge: 604800000, httpOnly: false, sameSite: 'Lax'})
|
||||||
res.json(result);
|
res.json(result);
|
||||||
api.useInvite(req.body.invite);
|
api.useInvite(req.body.invite);
|
||||||
return;
|
return;
|
||||||
@ -268,6 +269,7 @@ async function initAPI() {
|
|||||||
api.register(req.body.username, req.body.password, req.body.confirm).then( (result) => {
|
api.register(req.body.username, req.body.password, req.body.confirm).then( (result) => {
|
||||||
if(result[0]) return genToken(req.body.username).then((t) => {
|
if(result[0]) return genToken(req.body.username).then((t) => {
|
||||||
res.cookie('Authorization', t, {maxAge: 604800000, httpOnly: true, sameSite: 'Lax'});
|
res.cookie('Authorization', t, {maxAge: 604800000, httpOnly: true, sameSite: 'Lax'});
|
||||||
|
res.cookie('X-Auth-As', req.body.username, {maxAge: 604800000, httpOnly: false, sameSite: 'Lax'})
|
||||||
res.json(result);
|
res.json(result);
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user