Remove unwanted ! character in user token regex (#4830)
This commit is contained in:
parent
7882851539
commit
419cb7fbad
|
@ -195,7 +195,7 @@ export default class MiOS extends EventEmitter {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Get token from cookie or localStorage
|
// Get token from cookie or localStorage
|
||||||
const i = (document.cookie.match(/i=(!\w+)/) || [null, null])[1] || localStorage.getItem('i');
|
const i = (document.cookie.match(/i=(\w+)/) || [null, null])[1] || localStorage.getItem('i');
|
||||||
|
|
||||||
fetchme(i, me => {
|
fetchme(i, me => {
|
||||||
if (me) {
|
if (me) {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { ILocalUser } from '../../../models/entities/user';
|
||||||
import { ensure } from '../../../prelude/ensure';
|
import { ensure } from '../../../prelude/ensure';
|
||||||
|
|
||||||
function getUserToken(ctx: Koa.BaseContext) {
|
function getUserToken(ctx: Koa.BaseContext) {
|
||||||
return ((ctx.headers['cookie'] || '').match(/i=(!\w+)/) || [null, null])[1];
|
return ((ctx.headers['cookie'] || '').match(/i=(\w+)/) || [null, null])[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function compareOrigin(ctx: Koa.BaseContext) {
|
function compareOrigin(ctx: Koa.BaseContext) {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { ILocalUser } from '../../../models/entities/user';
|
||||||
import { ensure } from '../../../prelude/ensure';
|
import { ensure } from '../../../prelude/ensure';
|
||||||
|
|
||||||
function getUserToken(ctx: Koa.BaseContext) {
|
function getUserToken(ctx: Koa.BaseContext) {
|
||||||
return ((ctx.headers['cookie'] || '').match(/i=(!\w+)/) || [null, null])[1];
|
return ((ctx.headers['cookie'] || '').match(/i=(\w+)/) || [null, null])[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function compareOrigin(ctx: Koa.BaseContext) {
|
function compareOrigin(ctx: Koa.BaseContext) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { ILocalUser } from '../../../models/entities/user';
|
||||||
import { ensure } from '../../../prelude/ensure';
|
import { ensure } from '../../../prelude/ensure';
|
||||||
|
|
||||||
function getUserToken(ctx: Koa.BaseContext) {
|
function getUserToken(ctx: Koa.BaseContext) {
|
||||||
return ((ctx.headers['cookie'] || '').match(/i=(!\w+)/) || [null, null])[1];
|
return ((ctx.headers['cookie'] || '').match(/i=(\w+)/) || [null, null])[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function compareOrigin(ctx: Koa.BaseContext) {
|
function compareOrigin(ctx: Koa.BaseContext) {
|
||||||
|
|
Loading…
Reference in New Issue