You break out your retro hand held, fire up a game, and see that retroarch doesn't automatically log you into retroachievements.org. No problem; you open your retroarch settings, reset your user name and password, and restart the same game. Nope. You are still unable to log in. Let's fix this problem.
This is caused by a cached token that is saved in your retroarch configuration file. This token is generated by the retroachievements API and saved to your local retroarch.cfg file when you first authenticate yourself. Without knowing the specifics of the API, I am assuming that after a specific amount of time, or account inactivity, the token is invalidated by the API. This wouldn't be such a problem if the token would automatically refresh itself. However, this is not the case, and it is not possible to automatically get a new token from the API. Instead, the same invalid token remains in your retroarch.cfg file and prevents all future login attempts. I am not sure if this is a problem specific to ArkOS, or if it is a general problem with retoroarch. Let us know in the comments if you have more information.
The solution is simple. Firstly, let's remove the operating system SD card from the hand held and insert it into you computer. Mount the 4th partition to a local folder. For non-linux users, your OS will probably do this automatically. For example:
mount /dev/sdb4 /mnt/arkos
Change directories to the mounted file system:
Next, we need to edit the retroarch.cfg files. There will be two of them in the following directories:
Open the files in a text editor. You will need to replace the "cheevos_token" value with an empty string in both files:
cheevos_token = ""
If your password string is empty, replace it with your current password:
cheevos_password = "INSERT-YOUR-PASSWORD-HERE"
Save the files and quit. Let's test it. Plug the SD card back into your hand held, start up a game, and see if it works.
This is a hacky fix to this problem. It could be more streamlined with a shell script containing some quick sed magic. Or how about some automatic refresh capability straight out of the box? Let us know if you also have this problem, or if you know of a more elegant fix. If enough people are interested in a shell script, which would automate the process, let me know in the comments and I'll write one. Until next time, happy gaming.