@@ -225,7 +225,9 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
225225 const loginWithOAuthApp = useCallback (
226226 async ( data : LoginOAuthAppOptions ) => {
227227 const { authOptions, authCode } = await authGitHub ( data ) ;
228+
228229 const { token, hostname } = await getToken ( authCode , authOptions ) ;
230+
229231 const updatedAuth = await addAccount ( auth , 'OAuth App' , token , hostname ) ;
230232 setAuth ( updatedAuth ) ;
231233 saveState ( { auth : updatedAuth , settings } ) ;
@@ -235,7 +237,9 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
235237
236238 const loginWithPersonalAccessToken = useCallback (
237239 async ( { token, hostname } : LoginPersonalAccessTokenOptions ) => {
238- await headNotifications ( hostname , token ) ;
240+ const encryptedToken = ( await encryptValue ( token ) ) as Token ;
241+ await headNotifications ( hostname , encryptedToken ) ;
242+
239243 const updatedAuth = await addAccount (
240244 auth ,
241245 'Personal Access Token' ,
@@ -250,10 +254,8 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
250254
251255 const logoutFromAccount = useCallback (
252256 async ( account : Account ) => {
253- // Remove notifications for account
254257 removeAccountNotifications ( account ) ;
255258
256- // Remove from auth state
257259 const updatedAuth = removeAccount ( auth , account ) ;
258260 setAuth ( updatedAuth ) ;
259261 saveState ( { auth : updatedAuth , settings } ) ;
0 commit comments