sec: remove auth for other logins
This commit is contained in:
3 files changed
+7
-4
No files matched your search
@@ -1 +0,0 @@
|
||||
A lot of the code in here was either inspired or modified from https://github.com/aeharding/threadiverse, which is licensed under the AGPL 3.0.
|
||||
@@ -63,8 +63,11 @@ export function client({
|
||||
if (!instanceURL)
|
||||
instanceURL = profile.current.instance || DEFAULT_INSTANCE_URL
|
||||
|
||||
const jwt = auth ? auth : profile.current?.jwt
|
||||
// we use nullish coealsiaihsa something so that
|
||||
// we can set auth = '' to remove it
|
||||
const jwt = auth ?? profile.current?.jwt
|
||||
|
||||
// but not here, so that if jwt == '', it doesnt put a bearer
|
||||
const headers = jwt ? { authorization: `Bearer ${jwt}` } : {}
|
||||
|
||||
return new LemmyHttp(instanceToURL(instanceURL), {
|
||||
@@ -74,6 +77,7 @@ export function client({
|
||||
})
|
||||
}
|
||||
|
||||
// here for parts where i forgor to switch
|
||||
export function getClient(
|
||||
instanceURL?: string,
|
||||
func?: (
|
||||
@@ -89,7 +93,7 @@ export async function validateInstance(instance: string): Promise<boolean> {
|
||||
if (instance == '') return false
|
||||
|
||||
try {
|
||||
await getClient(instance).getSite()
|
||||
await client({ instanceURL: instance, auth: '' }).getSite()
|
||||
|
||||
return true
|
||||
} catch {
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
--font-display: Inter, system-ui, sans-serif;
|
||||
--font-mono: monospace;
|
||||
|
||||
--animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||
--animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards;
|
||||
|
||||
--ease-cubic: cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||
--spacing-22: 88px;
|
||||
|
||||
Reference in new issue
Block a user