generated from nestdotland/template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
🚀 Feature
All the info that should not be view or edited by the user should be stored in localstorage.
Motivation
Deno added support for WebStorage API
blog post: https://deno.com/blog/v1.10#support-for-web-storage-api
This would also make the code a bit cleaner since we won't have to poke the environment variables to find the home directory just to get the user's access token.
Implementation
The user would define the location during install like so:
deno install -qA --unstable --location https://nest.land https://nest.land/-/nest/nest.ts
and used like so:
// Add new user (nest login)
addUser(username: string, token: string) {
const users: Users = JSON.parse(localStorage.getItem('users'));
users[username] = { token }
localStorage.setItem('users', JSON.stringify(users);
}
addUser('maximousblk', 'NEST_6FF4C8F4374F46C5A5928AFE85C2354EA37AED00')
// Change active user (nest switch)
setActiveUser(username: string) {
localStorage.setItem('activeUser', username);
}
setActiveUser('maximousblk')
Alternatives
n/a
Additional context
n/a
SteelAlloy
Metadata
Metadata
Assignees
Labels
feature requestNew feature requestNew feature request