@@ -223,7 +223,9 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
223223 const loginWithOAuthApp = useCallback (
224224 async ( data : LoginOAuthAppOptions ) => {
225225 const { authOptions, authCode } = await authGitHub ( data ) ;
226+
226227 const { token, hostname } = await getToken ( authCode , authOptions ) ;
228+
227229 const updatedAuth = await addAccount ( auth , 'OAuth App' , token , hostname ) ;
228230 setAuth ( updatedAuth ) ;
229231 saveState ( { auth : updatedAuth , settings } ) ;
@@ -233,7 +235,9 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
233235
234236 const loginWithPersonalAccessToken = useCallback (
235237 async ( { token, hostname } : LoginPersonalAccessTokenOptions ) => {
236- await headNotifications ( hostname , token ) ;
238+ const encryptedToken = ( await encryptValue ( token ) ) as Token ;
239+ await headNotifications ( hostname , encryptedToken ) ;
240+
237241 const updatedAuth = await addAccount (
238242 auth ,
239243 'Personal Access Token' ,
@@ -248,10 +252,8 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
248252
249253 const logoutFromAccount = useCallback (
250254 async ( account : Account ) => {
251- // Remove notifications for account
252255 removeAccountNotifications ( account ) ;
253256
254- // Remove from auth state
255257 const updatedAuth = removeAccount ( auth , account ) ;
256258 setAuth ( updatedAuth ) ;
257259 saveState ( { auth : updatedAuth , settings } ) ;
0 commit comments