21 lines
634 B
TypeScript
21 lines
634 B
TypeScript
/**
|
|
* Thin wrapper around expo-secure-store for the auth token.
|
|
* Keyed identically to web/desktop ("multica_token") so logic stays aligned
|
|
* with packages/core/auth/store.ts even though storage backends differ.
|
|
*/
|
|
import * as SecureStore from "expo-secure-store";
|
|
|
|
const TOKEN_KEY = "multica_token";
|
|
|
|
export async function getToken(): Promise<string | null> {
|
|
return SecureStore.getItemAsync(TOKEN_KEY);
|
|
}
|
|
|
|
export async function setToken(token: string): Promise<void> {
|
|
await SecureStore.setItemAsync(TOKEN_KEY, token);
|
|
}
|
|
|
|
export async function clearToken(): Promise<void> {
|
|
await SecureStore.deleteItemAsync(TOKEN_KEY);
|
|
}
|