mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
Login flow working
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { SonosDevice } from "@svrooij/sonos/lib";
|
||||
import { v4 as uuid } from "uuid";
|
||||
import { MusicService, Credentials } from "../src/music_service";
|
||||
|
||||
import { Service, Device } from "../src/sonos";
|
||||
|
||||
@@ -55,23 +54,3 @@ export function getAppLinkMessage() {
|
||||
callbackPath: "",
|
||||
};
|
||||
}
|
||||
|
||||
export class InMemoryMusicService implements MusicService {
|
||||
users: Record<string, string> = {};
|
||||
|
||||
login({ username, password }: Credentials) {
|
||||
return username != undefined && password != undefined && this.users[username] == password;
|
||||
}
|
||||
|
||||
hasUser(credentials: Credentials) {
|
||||
this.users[credentials.username] = credentials.password;
|
||||
}
|
||||
|
||||
hasNoUsers() {
|
||||
this.users = {};
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.users = {};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user