mirror of
https://github.com/HeyPuter/puter
synced 2024-11-15 06:15:47 +00:00
dev: ensure existing app tokens don't break (for now)
This commit is contained in:
parent
6b8fbda14c
commit
f55b7ac0b8
@ -85,12 +85,16 @@ class AuthService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( decoded.type === 'app-under-user' ) {
|
if ( decoded.type === 'app-under-user' ) {
|
||||||
|
let session;
|
||||||
|
if ( decoded.session ) {
|
||||||
const session_uuid = this.uuid_fpe.decrypt(decoded.session);
|
const session_uuid = this.uuid_fpe.decrypt(decoded.session);
|
||||||
const session = await this.get_session_(session_uuid);
|
session = await this.get_session_(session_uuid);
|
||||||
|
|
||||||
if ( ! session ) {
|
if ( ! session ) {
|
||||||
throw APIError.create('token_auth_failed');
|
throw APIError.create('token_auth_failed');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const user = await get_user({ uuid: decoded.user_uid });
|
const user = await get_user({ uuid: decoded.user_uid });
|
||||||
if ( ! user ) {
|
if ( ! user ) {
|
||||||
throw APIError.create('token_auth_failed');
|
throw APIError.create('token_auth_failed');
|
||||||
@ -104,6 +108,7 @@ class AuthService extends BaseService {
|
|||||||
const actor_type = new AppUnderUserActorType({
|
const actor_type = new AppUnderUserActorType({
|
||||||
user,
|
user,
|
||||||
app,
|
app,
|
||||||
|
session,
|
||||||
});
|
});
|
||||||
|
|
||||||
return new Actor({
|
return new Actor({
|
||||||
|
Loading…
Reference in New Issue
Block a user